Slice Tools
  • Home
  • SourceForge Page


  • libFoundation
  • Home
  • Class Hierarchy
  • Class List
  • Class Members
  • Examples


  • SourceForge.net Logo
     

    LogCategory Class Reference

    #include <LogCategory.hh>

    Inheritance diagram for LogCategory:

    ostream List of all members.

    Detailed Description

    Provides an interface for logging to a specific category.

    LogCategory provides an interface to underlying CategoryInformation. LogCategory derives from ostream for insertion style logging, and creates LogMsg objects for all log messages, and sends them to the log manager.

    Examples:

    example-logging.cc.


    Public Member Functions

     LogCategory (const LogCategory &input)
     Copy Constructor copies everything but the stream.

     LogCategory (Logger *logger, std::string categoryName, MessageLevel messageLevel=MESSAGE_LEVEL_DEFAULT, MessageLevel filterLevel=MESSAGE_LEVEL_DEFAULT)
     Constructor asks the log manager for its category information.

     LogCategory (CategoryInformation *categoryInformation, Logger *logger)
     Constuctor saves pointers to the category information and main logger.

     ~LogCategory ()
     Deconstructor flushes the stream.

    LogCategory & operator= (const LogCategory &input)
     Assignment copies everything but the stream.

    LogCategory getCategory (std::string categoryName, MessageLevel messageLevel=MESSAGE_LEVEL_DEFAULT, MessageLevel filterLevel=MESSAGE_LEVEL_DEFAULT)
     Gets a LogCategory from the main logger.

    std::string getCategoryName () const
     Wrapper for m_category->getCategoryName().

    MessageLevel getFilterLevel () const
     Wrapper for m_category->getFilterLevel().

    void setFilterLevel (MessageLevel filterLevel)
     Wrapper for m_category->setFilterLevel().

    void setFilterLevel (int filterLevel)
     Simple Wrapper.

    MessageLevel getMessageLevel () const
     Wrapper for m_category->getMessageLevel().

    void setMessageLevel (MessageLevel messageLevel)
     Wrapper for m_category->setMessageLevel().

    void setMessageLevel (int messageLevel)
     Simple wrapper.

    void pushMessageLevel (MessageLevel messageLevel)
     Wrapper for m_category->pushMessageLevel().

    void pushMessageLevel (int messageLevel)
     Simple Wrapper.

    void popMessageLevel ()
     Wrapper for m_category->popMessageLevel().

    void disable ()
     Wrapper for m_category->disable().

    void logMsg (const std::string &msg, MessageLevel messageLevel=MESSAGE_LEVEL_DEFAULT) const
     Creates LogMsg object and sends it to log manager for writing.

    void debug (const std::string &msg) const
     Writes a message with message level at MESSAGE_LEVEL_DEBUG_HIGH.

    void debugH (const std::string &msg) const
     Writes a message with message level at MESSAGE_LEVEL_DEBUG_HIGH.

    void debugM (const std::string &msg) const
     Writes a message with message level at MESSAGE_LEVEL_DEBUG_MEDIUM.

    void debugL (const std::string &msg) const
     Writes a message with message level at MESSAGE_LEVEL_DEBUG_LOW.

    void information (const std::string &msg) const
     Writes a message with message level at MESSAGE_LEVEL_DEBUG_INFORMATION.

    void warning (const std::string &msg) const
     Writes a message with message level at MESSAGE_LEVEL_DEBUG_WARNING.

    void error (const std::string &msg) const
     Writes a message with message level at MESSAGE_LEVEL_DEBUG_ERROR.

    void fatal (const std::string &msg) const
     Writes a message with message level at MESSAGE_LEVEL_DEBUG_FATAL.

    void log (const std::string &msg) const
     Log a message at the active message level.


    Friends

    class LogStreamBuf
     The underling buffer is a friend so it can call back.


    Constructor & Destructor Documentation

    LogCategory::LogCategory (  const LogCategory &  input  ) 
     

    Copy Constructor copies everything but the stream.

    LogCategory::LogCategory (  Logger *  logger,
    std::string  categoryName,
    MessageLevel  messageLevel = MESSAGE_LEVEL_DEFAULT,
    MessageLevel  filterLevel = MESSAGE_LEVEL_DEFAULT
    ) 
     

    Constructor asks the log manager for its category information.

    LogCategory::LogCategory (  CategoryInformation *  categoryInformation,
    Logger *  logger
    ) 
     

    Constuctor saves pointers to the category information and main logger.

    Also, each LogCategory queries for its own pid at creation

    LogCategory::~LogCategory (   ) 
     

    Deconstructor flushes the stream.

    CategoryInformation can only be deleted by the main logger, so it is not deleted, nor is the log manager pointer.


    Member Function Documentation

    void LogCategory::debug (  const std::string &  msg  )  const
     

    Writes a message with message level at MESSAGE_LEVEL_DEBUG_HIGH.

    Parameters:
    msg String to log
    See also:
    logMsg
    Examples:
    example-logging.cc.

    void LogCategory::debugH (  const std::string &  msg  )  const
     

    Writes a message with message level at MESSAGE_LEVEL_DEBUG_HIGH.

    Parameters:
    msg String to log
    See also:
    logMsg

    void LogCategory::debugL (  const std::string &  msg  )  const
     

    Writes a message with message level at MESSAGE_LEVEL_DEBUG_LOW.

    Parameters:
    msg String to log
    See also:
    logMsg

    void LogCategory::debugM (  const std::string &  msg  )  const
     

    Writes a message with message level at MESSAGE_LEVEL_DEBUG_MEDIUM.

    Parameters:
    msg String to log
    See also:
    logMsg

    void LogCategory::disable (   ) 
     

    Wrapper for m_category->disable().

    See also:
    CategoryInformation::disable

    void LogCategory::error (  const std::string &  msg  )  const
     

    Writes a message with message level at MESSAGE_LEVEL_DEBUG_ERROR.

    Parameters:
    msg String to log
    See also:
    logMsg

    void LogCategory::fatal (  const std::string &  msg  )  const
     

    Writes a message with message level at MESSAGE_LEVEL_DEBUG_FATAL.

    Parameters:
    msg String to log
    See also:
    logMsg

    LogCategory LogCategory::getCategory (  std::string  categoryName,
    MessageLevel  messageLevel = MESSAGE_LEVEL_DEFAULT,
    MessageLevel  filterLevel = MESSAGE_LEVEL_DEFAULT
    ) 
     

    Gets a LogCategory from the main logger.

    See also:
    Logger::getCategory
    Returns:
    A LogCategory with its category of categoryName, and levels set

    std::string LogCategory::getCategoryName (   )  const
     

    Wrapper for m_category->getCategoryName().

    See also:
    CategoryInformation::getCategoryName
    Returns:
    Name of category

    MessageLevel LogCategory::getFilterLevel (   )  const
     

    Wrapper for m_category->getFilterLevel().

    See also:
    CategoryInformation::getFilterLevel
    Returns:
    Filter level

    MessageLevel LogCategory::getMessageLevel (   )  const
     

    Wrapper for m_category->getMessageLevel().

    See also:
    CategoryInformation::getMessageLevel
    Returns:
    Message level

    void LogCategory::information (  const std::string &  msg  )  const
     

    Writes a message with message level at MESSAGE_LEVEL_DEBUG_INFORMATION.

    Parameters:
    msg String to log
    See also:
    logMsg

    void LogCategory::log (  const std::string &  msg  )  const
     

    Log a message at the active message level.

    Parameters:
    msg String to log
    See also:
    logMsg
    Examples:
    example-logging.cc.

    void LogCategory::logMsg (  const std::string &  msg,
    MessageLevel  messageLevel = MESSAGE_LEVEL_DEFAULT
    )  const
     

    Creates LogMsg object and sends it to log manager for writing.

    Logs a new LogMsg with the message

    See also:
    Logger::writeLog
    Parameters:
    msg Message to log
    messageLevel Message Level of message

    LogCategory & LogCategory::operator= (  const LogCategory &  input  ) 
     

    Assignment copies everything but the stream.

    void LogCategory::popMessageLevel (   ) 
     

    Wrapper for m_category->popMessageLevel().

    See also:
    CategoryInformation::popMessageLevel
    Examples:
    example-logging.cc.

    void LogCategory::pushMessageLevel (  int  messageLevel  ) 
     

    Simple Wrapper.

    See also:
    LogCategory::pushMessageLevel(MessageLevel)
    Parameters:
    messageLevel New message level

    void LogCategory::pushMessageLevel (  MessageLevel  messageLevel  ) 
     

    Wrapper for m_category->pushMessageLevel().

    See also:
    CategoryInformation::pushMessageLevel
    Parameters:
    messageLevel New message level
    Examples:
    example-logging.cc.

    void LogCategory::setFilterLevel (  int  filterLevel  ) 
     

    Simple Wrapper.

    See also:
    LogCategory::setFilterLevel(MessageLevel)
    Parameters:
    filterLevel New filter level

    void LogCategory::setFilterLevel (  MessageLevel  filterLevel  ) 
     

    Wrapper for m_category->setFilterLevel().

    See also:
    CategoryInformation::setFilterLevel
    Parameters:
    filterLevel New filter level

    void LogCategory::setMessageLevel (  int  messageLevel  ) 
     

    Simple wrapper.

    See also:
    LogCategory::setMessageLevel(MessageLevel)
    Parameters:
    messageLevel New message level

    void LogCategory::setMessageLevel (  MessageLevel  messageLevel  ) 
     

    Wrapper for m_category->setMessageLevel().

    See also:
    CategoryInformation::setMessageLevel
    Parameters:
    messageLevel New message level
    Examples:
    example-logging.cc.

    void LogCategory::warning (  const std::string &  msg  )  const
     

    Writes a message with message level at MESSAGE_LEVEL_DEBUG_WARNING.

    Parameters:
    msg String to log
    See also:
    logMsg


    Friends And Related Function Documentation

    friend class LogStreamBuf [friend]
     

    The underling buffer is a friend so it can call back.


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