|
libassa 3.5.1
|
An abstraction to message logging facility. More...
#include <sys/types.h>#include <string.h>#include <stdio.h>#include <string>#include <stack>#include "assa/Logger_Impl.h"#include "assa/Singleton.h"#include "assa/MemDump.h"Go to the source code of this file.
Classes | |
| class | ASSA::Logger |
| class | ASSA::DiagnosticContext |
| Class DiagnosticContext tracks who deep a function is in the calling stack. More... | |
Namespaces | |
| namespace | ASSA |
| namespace | ASSA::Log |
Macros | |
| #define | LOGGER ASSA::Logger::get_instance() |
| A shortcut to locate a singleton object of class Logger. | |
| #define | DL(X) |
| A macro for writing debug message to the Logger. | |
| #define | EL(X) |
| A macro for writing error message to the Logger. | |
| #define | trace(s) ASSA::DiagnosticContext tRaCeR(s); |
| trace() is used to trace function call chain in C++ program. | |
| #define | trace_with_mask(s, m) ASSA::DiagnosticContext tRaCeR(s, m); |
| trace_with_mask() is used to trace function call chain in C++ program. | |
Functions | |
| void | ASSA::Log::set_app_name (const std::string &appname_) |
| Set application name. | |
| int | ASSA::Log::open_log_file (const char *logfname_, u_long groups_=ALL, u_long maxsize_=10485760) |
| Open log file. | |
| int | ASSA::Log::open_log_stdout (u_long groups_=ALL) |
| Write log message to standard output. | |
| int | ASSA::Log::open_log_server (const std::string &logsvraddr_, const char *logfname_, Reactor *reactor_, u_long groups_=ASSA::ALL, u_long maxsize_=10485760) |
| Open connection with and write log message to the log server. | |
| void | ASSA::Log::log_resync (void) |
| Resynchronize logging stream after Fork. | |
| int | ASSA::Log::log_close (void) |
| Close logging stream. | |
| void | ASSA::Log::set_gmt_timezone (void) |
| Set timezone to GMT. | |
| void | ASSA::Log::enable_timestamp (void) |
| Enable timestamp logging. | |
| void | ASSA::Log::disable_timestamp (void) |
| Disable timestamp logging. | |
An abstraction to message logging facility.
Definition in file Logger.h.
| #define DL | ( | X | ) |
| #define EL | ( | X | ) |
| #define LOGGER ASSA::Logger::get_instance() |
| #define trace | ( | s | ) | ASSA::DiagnosticContext tRaCeR(s); |
trace() is used to trace function call chain in C++ program.
trace() logs a message of type [function_name] –v– with log level TRACE, where 'function_name' is the argument supplied. Upon exiting from the function, record [function_name] –^– is written to the log file.
Application user can easily turn trace on/off by supplying different debug mask with {'-m', '–mask'} command-line argument and masking out highest bit in debug mask: TRACE
| #define trace_with_mask | ( | s, | |
| m | |||
| ) | ASSA::DiagnosticContext tRaCeR(s, m); |
trace_with_mask() is used to trace function call chain in C++ program.
Mask is used to limit the scope of the messages.