Inheritance diagram for ErrLog:
This output stream is used for issuing errors, "information", debugging tracing, etc. to the operator (e.g., stderr) or to a file, somewhat like syslog.
ErrLog errlog(log_to_unix_file, "sm.errlog"); errlog->clog << info_prio << "Restart recovery : analysis phase " << flushl;
Definition at line 193 of file errlog.h.
Public Member Functions | |
ErrLog (const char *ident, LoggingDestination dest, const char *filename=0, LogPriority level=default_prio, char *ownbuf=0, int ownbufsz=0) | |
ErrLog (const char *ident, LoggingDestination dest, FILE *file=0, LogPriority level=default_prio, char *ownbuf=0, int ownbufsz=0) | |
~ErrLog () | |
void | log (enum LogPriority prio, const char *format,...) |
const char * | ident () |
LoggingDestination | destination () |
LogPriority | getloglevel () |
const char * | getloglevelname () |
LogPriority | setloglevel (LogPriority prio) |
Static Public Member Functions | |
static LogPriority | parse (const char *arg, bool *ok=0) |
Public Attributes | |
logstream | clog |
Friends | |
logstream * | is_logstream (std::basic_ostream< char, std::char_traits< char > > &) |
ostream & | flush_and_setprio (ostream &o, LogPriority p) |
ErrLog::ErrLog | ( | const char * | ident, | |
LoggingDestination | dest, | |||
const char * | filename = 0 , |
|||
LogPriority | level = default_prio , |
|||
char * | ownbuf = 0 , |
|||
int | ownbufsz = 0 | |||
) |
Create a log.
[in] | ident | The name of the log. |
[in] | dest | Indicates destination (unix file, stderr, etc). |
[in] | filename | Name of destination or "-' . |
[in] | level | Minimum priority level of messages to be sent to the file. For filtering. |
[in] | ownbuf | Buffer to use. Default is NULL. |
[in] | ownbufsz | Size of given buffer. Default is 0. |
Definition at line 323 of file errlog.cpp.
References W_FATAL_MSG.
ErrLog::ErrLog | ( | const char * | ident, | |
LoggingDestination | dest, | |||
FILE * | file = 0 , |
|||
LogPriority | level = default_prio , |
|||
char * | ownbuf = 0 , |
|||
int | ownbufsz = 0 | |||
) |
Create a log.
[in] | ident | The name of the log. |
[in] | dest | Indicates destination (unix file, stderr, etc). |
[in] | file | Already open FILE*. Default is NULL. |
[in] | level | Minimum priority level of messages to be sent to the file. For filtering. |
[in] | ownbuf | Buffer to use. Default is NULL. |
[in] | ownbufsz | Size of given buffer. Default is 0. |
Definition at line 373 of file errlog.cpp.
References w_assert9.
LogPriority ErrLog::parse | ( | const char * | arg, | |
bool * | ok = 0 | |||
) | [static] |
Convert a char string to an enumeration value.
[in] | arg | The string to parse. |
[out] | ok | Returns true/false if parse worked/not (optional) |
Definition at line 225 of file errlog.cpp.
void ErrLog::log | ( | enum LogPriority | prio, | |
const char * | format, | |||
... | ||||
) |
Format and issue a message with the given priority, that is, don't issue it unless this priority is equal to or higher than the priority of this error log.
Definition at line 430 of file errlog.cpp.
References w_reset_strstream.
const char* ErrLog::ident | ( | ) | [inline] |
LogPriority ErrLog::getloglevel | ( | ) | [inline] |
const char* ErrLog::getloglevelname | ( | ) | [inline] |
LogPriority ErrLog::setloglevel | ( | LogPriority | prio | ) |
Change the current logging level
Definition at line 215 of file errlog.cpp.