syBR::Core::Logger Class Reference

Logger class. More...

#include <Logger.hpp>

List of all members.

Public Types

enum  Type { TYPE_INFORMATION = 0, TYPE_WARNING, TYPE_ERROR }
 Type of a log entry. More...
enum  Category {
  CATEGORY_CORE = 0, CATEGORY_INPUT, CATEGORY_RENDERER, CATEGORY_AUDIO,
  CATEGORY_NETWORK, CATEGORY_GAME, CATEGORY_OTHER
}
 Category of a log entry. More...

Public Member Functions

 Logger (const std::string &filename)
 Constructor.
 ~Logger ()
 Destructor.
template<typename T>
Loggeroperator<< (const T &value)
Loggeroperator<< (std::ostream &(*fn)(std::ostream &))
 Print a stream modifier to the log.
Loggeroperator<< (std::ios &(*fn)(std::ios &))
 Print a stream modifier to the log.
Loggeroperator<< (std::ios_base &(*fn)(std::ios_base &))
 Print a stream modifier to the log.
Loggeroperator<< (const Type type)
 Print the type of a log entry to the log.
Loggeroperator<< (const Category category)
 Print the category of a log entry to the log.
void printHeader ()
 Print headers in the log file.

Private Attributes

std::ofstream m_stream
 Output stream.


Detailed Description

Logger class.

Member Enumeration Documentation

enum syBR::Core::Logger::Type

Type of a log entry.

Enumerator:
TYPE_INFORMATION  Information.
TYPE_WARNING  Warning.
TYPE_ERROR  Error.

enum syBR::Core::Logger::Category

Category of a log entry.

Enumerator:
CATEGORY_CORE  Core.
CATEGORY_INPUT  Input.
CATEGORY_RENDERER  Renderer.
CATEGORY_AUDIO  Audio.
CATEGORY_NETWORK  Network.
CATEGORY_GAME  Game.
CATEGORY_OTHER  Other, to be specified.


Constructor & Destructor Documentation

syBR::Core::Logger::Logger ( const std::string &  filename  ) 

Constructor.

Parameters:
filename Name of the log file (stored in the log/ subdirectory)

syBR::Core::Logger::~Logger (  ) 

Destructor.


Member Function Documentation

template<typename T>
Logger& syBR::Core::Logger::operator<< ( const T &  value  )  [inline]

Logger& syBR::Core::Logger::operator<< ( std::ostream &(*)(std::ostream &)  fn  )  [inline]

Print a stream modifier to the log.

Parameters:
fn Stream modifier to be written to the log
Returns:
Logger instance

Logger& syBR::Core::Logger::operator<< ( std::ios &(*)(std::ios &)  fn  )  [inline]

Print a stream modifier to the log.

Parameters:
fn Stream modifier to be written to the log
Returns:
Logger instance

Logger& syBR::Core::Logger::operator<< ( std::ios_base &(*)(std::ios_base &)  fn  )  [inline]

Print a stream modifier to the log.

Parameters:
fn Stream modifier to be written to the log
Returns:
Logger instance

Logger & syBR::Core::Logger::operator<< ( const Type  type  ) 

Print the type of a log entry to the log.

Parameters:
type Type of the log entry to be written next
Returns:
Logger instance

Logger & syBR::Core::Logger::operator<< ( const Category  category  ) 

Print the category of a log entry to the log.

Parameters:
category Category of the log entry to be written next
Returns:
Logger instance

void syBR::Core::Logger::printHeader (  ) 

Print headers in the log file.

The headers consist of the following items:


Member Data Documentation

std::ofstream syBR::Core::Logger::m_stream [private]

Output stream.


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

Copyright © 2008 by Sebastien Frippiat
Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License.
Last modified Tue Dec 30 17:57:33 2008