libassa 3.5.1
|
#include <Logger_Impl.h>
Static Public Attributes | |
static const unsigned int | LOGGER_MAXLINE = 6660 |
Maximum length of the formatted message. | |
Protected Member Functions | |
virtual u_short | add_timestamp (ostream &sink_) |
virtual u_short | indent_func_name (ostream &sink_, const string &funcname_, size_t indent_level_, marker_t type_) |
char * | format_msg (size_t expected_sz_, const char *fmt_, va_list vap_, bool &release_) |
Format and put the message in the buffer. | |
Protected Attributes | |
u_short | m_indent_step |
Indentation step. | |
u_long | m_groups |
Enabled groups. | |
string | m_logfname |
Log file name. | |
bool | m_tmflg |
Timestamp on/off flag. | |
int | m_tz |
Timezone: 0-GMT, 1-Local. | |
Static Protected Attributes | |
static char | m_msgbuf [LOGGER_MAXLINE] |
Static buffer for formatted message. | |
Definition at line 141 of file Logger_Impl.h.
|
inline |
Definition at line 252 of file Logger_Impl.h.
|
inlinevirtual |
Definition at line 153 of file Logger_Impl.h.
|
protectedvirtual |
Definition at line 34 of file Logger_Impl.cpp.
References ASSA::TimeVal::gettimeofday(), m_tz, and timestamp_enabled().
Referenced by ASSA::FileLogger::log_func(), ASSA::RemoteLogger::log_func(), ASSA::StdOutLogger::log_func(), ASSA::FileLogger::log_msg(), ASSA::RemoteLogger::log_msg(), and ASSA::StdOutLogger::log_msg().
Definition at line 162 of file Logger_Impl.h.
References m_groups.
Referenced by ASSA::Logger::disable_all_groups().
Definition at line 156 of file Logger_Impl.h.
References m_groups.
Referenced by ASSA::Logger::disable_group().
Definition at line 159 of file Logger_Impl.h.
References m_groups.
Referenced by ASSA::Logger::disable_groups().
Definition at line 167 of file Logger_Impl.h.
References m_tmflg.
Referenced by ASSA::Logger::disable_timestamp().
Definition at line 161 of file Logger_Impl.h.
References ASSA::ALL, and m_groups.
Referenced by ASSA::Logger::enable_all_groups().
Definition at line 155 of file Logger_Impl.h.
References m_groups.
Referenced by ASSA::Logger::enable_group().
Definition at line 158 of file Logger_Impl.h.
References m_groups.
Referenced by ASSA::Logger::enable_groups().
Definition at line 166 of file Logger_Impl.h.
References m_tmflg.
Referenced by ASSA::Logger::enable_timestamp().
|
protected |
Format and put the message in the buffer.
If expected size is smaller then LOGGER_MAXLINE, formatted message is written to the static buffer and release_ is set to false. Otherwise, this function allocates a buffer on the heap big enough to hold the message and set release_ to true. In this case caller is responsible for releasing the memory by calling delete [].
expected_sz_ | Expected size of the formatted message |
fmt_ | printf()-like format string |
vap_ | variable argument parameters list |
release_ | [OUT] if true, caller is responsible for memory deallocation. |
Definition at line 85 of file Logger_Impl.cpp.
References LOGGER_MAXLINE, and m_msgbuf.
Referenced by ASSA::FileLogger::log_msg(), ASSA::RemoteLogger::log_msg(), and ASSA::StdOutLogger::log_msg().
Definition at line 164 of file Logger_Impl.h.
References m_groups.
Referenced by ASSA::Logger::group_enabled(), ASSA::FileLogger::log_func(), ASSA::RemoteLogger::log_func(), ASSA::StdOutLogger::log_func(), ASSA::FileLogger::log_msg(), ASSA::RemoteLogger::log_msg(), and ASSA::StdOutLogger::log_msg().
|
protectedvirtual |
Definition at line 53 of file Logger_Impl.cpp.
References ASSA::FUNC_ENTRY, ASSA::FUNC_EXIT, ASSA::FUNC_MSG, and m_indent_step.
Referenced by ASSA::FileLogger::log_func(), ASSA::RemoteLogger::log_func(), ASSA::StdOutLogger::log_func(), ASSA::FileLogger::log_msg(), ASSA::RemoteLogger::log_msg(), and ASSA::StdOutLogger::log_msg().
Implemented in ASSA::FileLogger, ASSA::RemoteLogger, and ASSA::StdOutLogger.
Referenced by ASSA::Logger::log_close().
|
pure virtual |
Implemented in ASSA::FileLogger, ASSA::RemoteLogger, and ASSA::StdOutLogger.
Referenced by ASSA::Logger::log_func().
|
pure virtual |
Implemented in ASSA::FileLogger, ASSA::RemoteLogger, and ASSA::StdOutLogger.
Referenced by ASSA::Logger::log_msg().
|
inlinevirtual |
Open connection with Log Server.
Reimplemented in ASSA::RemoteLogger.
Definition at line 281 of file Logger_Impl.h.
|
inlinevirtual |
Open File Logger.
Reimplemented in ASSA::FileLogger.
Definition at line 271 of file Logger_Impl.h.
Open StdErr Logger.
Reimplemented in ASSA::StdOutLogger.
Definition at line 263 of file Logger_Impl.h.
Referenced by ASSA::Logger::log_open(), ASSA::Logger::log_open(), and ASSA::Logger::log_open().
Reimplemented in ASSA::StdOutLogger, ASSA::FileLogger, and ASSA::RemoteLogger.
Definition at line 190 of file Logger_Impl.h.
Referenced by ASSA::Logger::log_resync().
Definition at line 171 of file Logger_Impl.h.
References m_indent_step.
Definition at line 169 of file Logger_Impl.h.
References m_tz.
Referenced by ASSA::Logger::set_timezone().
Definition at line 168 of file Logger_Impl.h.
References m_tmflg.
Referenced by add_timestamp(), and ASSA::Logger::timestamp_enabled().
Maximum length of the formatted message.
The size is selected based on the maximum number of bytes transmitted through Socketbuf which is 1416. This is at most the bytes dumped with MemDump - (1416/16 + 2) * 74 = 6660. See MemDump.cpp comments for details.
Definition at line 149 of file Logger_Impl.h.
Referenced by format_msg().
|
protected |
Enabled groups.
Definition at line 239 of file Logger_Impl.h.
Referenced by disable_all_groups(), disable_group(), disable_groups(), ASSA::FileLogger::dump(), enable_all_groups(), enable_group(), enable_groups(), group_enabled(), ASSA::FileLogger::log_close(), ASSA::RemoteLogger::log_open(), ASSA::FileLogger::log_open(), and ASSA::StdOutLogger::log_open().
|
protected |
Indentation step.
Definition at line 236 of file Logger_Impl.h.
Referenced by ASSA::FileLogger::dump(), get_indent_step(), indent_func_name(), and set_indent_step().
|
protected |
Log file name.
Definition at line 242 of file Logger_Impl.h.
Referenced by ASSA::FileLogger::dump(), ASSA::RemoteLogger::handle_close(), ASSA::FileLogger::handle_rollover(), ASSA::FileLogger::log_close(), ASSA::RemoteLogger::log_open(), and ASSA::FileLogger::log_open().
|
staticprotected |
Static buffer for formatted message.
Definition at line 233 of file Logger_Impl.h.
Referenced by format_msg().
|
protected |
Timestamp on/off flag.
Definition at line 245 of file Logger_Impl.h.
Referenced by disable_timestamp(), ASSA::FileLogger::dump(), enable_timestamp(), and timestamp_enabled().
|
protected |
Timezone: 0-GMT, 1-Local.
Definition at line 248 of file Logger_Impl.h.
Referenced by add_timestamp(), and set_timezone().