libassa  3.5.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Public Member Functions | Private Member Functions | List of all members
ASSA::StdOutLogger Class Reference

#include <StdOutLogger.h>

Inheritance diagram for ASSA::StdOutLogger:
ASSA::Logger_Impl

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 &)
StdOutLoggeroperator= (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

ASSA::StdOutLogger::StdOutLogger ( )
inline

Definition at line 35 of file StdOutLogger.h.

{ /*empty*/ }
ASSA::StdOutLogger::StdOutLogger ( const StdOutLogger )
private

Member Function Documentation

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

Implements ASSA::Logger_Impl.

Definition at line 70 of file StdOutLogger.h.

{
return 0;
}
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 60 of file StdOutLogger.cpp.

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

{
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;
}
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 28 of file StdOutLogger.cpp.

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().

{
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;
}
int ASSA::StdOutLogger::log_open ( u_long  groups_)
inlinevirtual

Open StdErr Logger.

Reimplemented from ASSA::Logger_Impl.

Definition at line 62 of file StdOutLogger.h.

References ASSA::Logger_Impl::m_groups.

{
m_groups = groups_;
return 0;
}
void ASSA::StdOutLogger::log_resync ( void  )
inlinevirtual

Reimplemented from ASSA::Logger_Impl.

Definition at line 77 of file StdOutLogger.h.

References ASSA::flush().

{
std::cout << std::flush;
}
StdOutLogger& ASSA::StdOutLogger::operator= ( const StdOutLogger )
private

no cloning


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