Loading...
Searching...
No Matches
ASSA::StdOutLogger Class Reference

`#include <StdOutLogger.h>`

Inheritance diagram for ASSA::StdOutLogger:

## Public Member Functions

| StdOutLogger ()
virtual int | log_open (u_long groups_)
| Open StdErr Logger.
virtual int | log_close (void)
virtual int | log_msg (Group g_, size_t indent_level_, const string &func_name_, size_t expected_sz_, const char *fmt_, va_list)
virtual int | log_func (Group g_, size_t indent_level_, const string &func_name_, marker_t type_)
virtual void | log_resync ()
Public Member Functions inherited from ASSA::Logger_Impl
| Logger_Impl ()
virtual | ~Logger_Impl ()
void | enable_group (Group g_)
void | disable_group (Group g_)
void | enable_groups (u_long g_)
void | disable_groups (u_long g_)
void | enable_all_groups (void)
void | disable_all_groups (void)
bool | group_enabled (Group g_) const
void | enable_timestamp (void)
void | disable_timestamp (void)
bool | timestamp_enabled (void) const
void | set_timezone (int zone_)
void | set_indent_step (u_short step_)
u_short | get_indent_step (void) const
virtual int | log_open (const char *logfname_, u_long groups_, u_long maxsize_)
| Open File Logger.
virtual int | log_open (const char *appname_, const char *logfname_, u_long groups_, u_long maxsize_, Reactor *reactor_)
| Open connection with Log Server.

## Private Member Functions

| StdOutLogger (const StdOutLogger &)
StdOutLogger & | operator= (const StdOutLogger &)
| no cloning

## Additional Inherited Members

Static Public Attributes inherited from ASSA::Logger_Impl
static const unsigned int | LOGGER_MAXLINE = 6660
| Maximum length of the formatted message.
Protected Member Functions inherited from ASSA::Logger_Impl
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 inherited from ASSA::Logger_Impl
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 inherited from ASSA::Logger_Impl
static char | m_msgbuf [LOGGER_MAXLINE]
| Static buffer for formatted message.

## Detailed Description

Definition at line 32 of file StdOutLogger.h.

## Constructor & Destructor Documentation

## StdOutLogger() [1/2]

ASSA::StdOutLogger::StdOutLogger | ( |  | ) |

inline

Definition at line 35 of file StdOutLogger.h.

{ /*empty*/ }

Referenced by operator=(), and StdOutLogger().

## StdOutLogger() [2/2]

ASSA::StdOutLogger::StdOutLogger | ( | const StdOutLogger & |  | ) |

private

References StdOutLogger().

## Member Function Documentation

## log_close()

int ASSA::StdOutLogger::log_close | ( | void |  | ) |

inline virtual

Implements ASSA::Logger_Impl.

Definition at line 69 of file StdOutLogger.h.

{
return 0;
}

## log_func()

int StdOutLogger::log_func | ( | Group | g_,
|  | size_t | indent_level_,
|  | const string & | func_name_,
|  | marker_t | type_ )

virtual

Implements ASSA::Logger_Impl.

Definition at line 59 of file StdOutLogger.cpp.

{
if (! group_enabled (g_)) {
return 0;
}
add_timestamp (std::cerr);
indent_func_name (std::cout, func_name_, indent_level_, type_);
if (type_ == FUNC_ENTRY) {
std::cout << "---v---\n";
}
else if (type_ == FUNC_EXIT) {
std::cout << "---^---\n";
}
return 0;
}
ASSA::Logger_Impl::indent_func_name
virtual u_short indent_func_name(ostream &sink_, const string &funcname_, size_t indent_level_, marker_t type_)
Definition Logger_Impl.cpp:54
ASSA::Logger_Impl::group_enabled
bool group_enabled(Group g_) const
Definition Logger_Impl.h:164
ASSA::Logger_Impl::add_timestamp
virtual u_short add_timestamp(ostream &sink_)
Definition Logger_Impl.cpp:35
ASSA::FUNC_ENTRY
@ FUNC_ENTRY
Definition LogMask.h:69
ASSA::FUNC_EXIT
@ FUNC_EXIT
Definition LogMask.h:70

References ASSA::Logger_Impl::add_timestamp(), ASSA::FUNC_ENTRY, ASSA::FUNC_EXIT, ASSA::Logger_Impl::group_enabled(), and ASSA::Logger_Impl::indent_func_name().

## log_msg()

int StdOutLogger::log_msg | ( | Group | g_,
|  | size_t | indent_level_,
|  | const string & | func_name_,
|  | size_t | expected_sz_,
|  | const char * | fmt_,
|  | va_list | msg_list_ )

virtual

Implements ASSA::Logger_Impl.

Definition at line 27 of file StdOutLogger.cpp.

{
bool release = false;
char* msgbuf_ptr = NULL;
if (! group_enabled (g_)) {
return 0;
}
add_timestamp (std::cerr);
indent_func_name (std::cerr, func_name_, indent_level_, FUNC_MSG);
msgbuf_ptr = format_msg (expected_sz_, fmt_, msg_list_, release);
if (msgbuf_ptr == NULL) {
return -1; // failed to format
}
std::cout << msgbuf_ptr;
if (release) {
delete [] msgbuf_ptr;
}
return 0;
}
ASSA::Logger_Impl::format_msg
char * format_msg(size_t expected_sz_, const char *fmt_, va_list vap_, bool &release_)
Format and put the message in the buffer.
Definition Logger_Impl.cpp:86
ASSA::FUNC_MSG
@ FUNC_MSG
Definition LogMask.h:68

References ASSA::Logger_Impl::add_timestamp(), ASSA::Logger_Impl::format_msg(), ASSA::FUNC_MSG, ASSA::Logger_Impl::group_enabled(), and ASSA::Logger_Impl::indent_func_name().

## log_open()

int ASSA::StdOutLogger::log_open | ( | u_long | groups_ | ) |

inline virtual

Open StdErr Logger.

Reimplemented from ASSA::Logger_Impl.

Definition at line 61 of file StdOutLogger.h.

{
m_groups = groups_;
return 0;
}
ASSA::Logger_Impl::m_groups
u_long m_groups
Enabled groups.
Definition Logger_Impl.h:239

References ASSA::Logger_Impl::m_groups.

## log_resync()

void ASSA::StdOutLogger::log_resync | ( | void |  | ) |

inline virtual

Reimplemented from ASSA::Logger_Impl.

Definition at line 76 of file StdOutLogger.h.

{
std::cout << std::flush;
}

## operator=()

StdOutLogger & ASSA::StdOutLogger::operator= | ( | const StdOutLogger & |  | ) |

private

no cloning

References StdOutLogger().

The documentation for this class was generated from the following files:

- StdOutLogger.h
- StdOutLogger.cpp