43 #ifndef ___APPLOG_H___
44 #define ___APPLOG_H___
57 #ifdef CCXX_NAMESPACES
89 HEXdump(
const unsigned char *buffer,
int buff_len,
int max_len = 200);
126 #ifdef CCXX_EXCEPTIONS
131 class __EXPORT AppLogException :
public ost::Exception
138 AppLogException(
const std::string &what_arg) : ost::Exception(what_arg) {};
178 void writeLog(
bool endOfLine =
true);
179 static map<string, Slog::Level> *
assoc;
209 Ident(
const char *str) : _ident(str) {};
214 std::string&
str() {
return _ident;}
219 Ident& operator= (std::string &st) {_ident = st;
return *
this;}
224 Ident& operator= (
const char str[]) {_ident = str;
return *
this;}
229 const char*
c_str() {
return _ident.c_str();}
240 AppLog(
const char* logFileName = NULL,
bool logDirectly =
false ,
bool usePipe =
false);
248 AppLog(
const char* logFileName = NULL,
bool logDirectly =
false);
274 void logFileName(
const char* FileName,
bool logDirectly =
false,
bool usePipe =
false);
282 void logFileName(
const char* FileName,
bool logDirectly =
false);
299 void clogEnable(
bool en =
true);
305 void slogEnable(
bool en =
true);
312 void identLevel(
const char *ident,
Slog::Level level);
318 void open(
const char *ident);
325 virtual int overflow(
int c);
338 void emerg(
const char *format, ...);
344 void alert(
const char *format, ...);
350 void critical(
const char *format, ...);
356 void error(
const char *format, ...);
362 void warn(
const char *format, ...);
368 void notice(
const char *format, ...);
374 void info(
const char *format, ...);
380 void debug(
const char *format, ...);
513 map<string, Slog::Level>::iterator it = assoc->find(name);
589 #ifdef CCXX_NAMESPACES
593 #endif //___APPLOG_H___
AppLog & error(void)
error level
std::string str()
string cast provided for conveneince.
static Slog::Level levelTranslate(string name)
Translates level from string to Slog::Level, useful for configuration files for instance.
std::string & str()
std::string cast.
__EXPORT AppLog & debug(AppLog &sl)
Manipulator for debug level.
__EXPORT AppLog & error(AppLog &sl)
Manipulator for error level.
const char * c_str()
const char* cast provided for conveneince.
__EXPORT AppLog & info(AppLog &sl)
Manipulator for info level.
Ident(Ident &id)
Copy constructor.
Ident(const char *str)
const char* constructor, provided for convenience.
static map< string, Slog::Level > * assoc
GNU Common C++ exception model base classes.
AppLog & warn(void)
warn level
__EXPORT std::ostream & operator<<(std::ostream &os, const IPV4Address &ia)
AppLog & critical(void)
critical level
Produces a dump of a buffer in a hexdump way with its code Ascii translation and relative buffer addr...
const char * c_str() const
const char* cast provided for conveneince.
__EXPORT AppLog & emerg(AppLog &sl)
Manipulator for emerg level.
AppLog & debug(void)
debug level
__EXPORT AppLog & notice(AppLog &sl)
Manipulator for notice level.
virtual ~HEXdump()
HEXdump destructor.
AppLog & emerg(void)
emerg level
Ident class that represents module name.
AppLog & operator()(Ident &ident)
operator to change ident
__EXPORT AppLog & alert(AppLog &sl)
Manipulator for alert level.
__EXPORT AppLog alog
alog global log stream definition
System logging facilities abstraction.
AppLog & notice(void)
notice level
std::string _str
output string
Application logger is a class that implements a logger that can be used by applications to save log f...
AppLog & info(void)
info level
__EXPORT AppLog & warn(AppLog &sl)
Manipulator for warn level.
__EXPORT AppLog & critical(AppLog &sl)
Manipulator for critical level.
AppLog & alert(void)
alert level