libassa 3.5.0
Public Member Functions | Private Member Functions

ASSA::StdOutLogger Class Reference

#include <StdOutLogger.h>

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

List of all members.

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

Private Member Functions

 StdOutLogger (const StdOutLogger &)
StdOutLoggeroperator= (const StdOutLogger &)
 no cloning

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  ) [inline, virtual]

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_) [inline, virtual]

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  ) [inline, virtual]

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:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines