libcamgm
Classes | Public Types | Public Member Functions | Static Public Member Functions | Private Member Functions | Friends | Related Functions | List of all members
ca_mgm::LogControl Class Reference

#include <LogControl.hpp>

Classes

struct  LineFormater
 
struct  ShortLineFormater
 

Public Types

typedef log::LineWriter LineWriter
 

Public Member Functions

void setLineFormater (const shared_ptr< LineFormater > &formater_r)
 
void setShortLineFormater ()
 
void logfile (const path::PathName &logfile_r)
 
void logfile (const path::PathName &logfile_r, mode_t mode_r)
 
void logNothing ()
 
void logToStdErr ()
 
bool isEnabledFor (logger::LogLevel level_r)
 
void setLogLevel (logger::LogLevel level_r)
 
shared_ptr< LineWritergetLineWriter () const
 
void setLineWriter (const shared_ptr< LineWriter > &writer_r)
 

Static Public Member Functions

static LogControl instance ()
 

Private Member Functions

 LogControl ()
 

Friends

std::ostream & operator<< (std::ostream &str, const LogControl &obj)
 

Related Functions

(Note that these are not member functions.)

std::ostream & operator<< (std::ostream &str, const LogControl &obj)
 

Detailed Description

Maintain logfile related options.

Note
A Singleton using a Singleton implementation class, that's why there is no _pimpl like in other classes.

Member Typedef Documentation

See Also
log::LineWriter

Constructor & Destructor Documentation

ca_mgm::LogControl::LogControl ( )
inlineprivate

Default ctor: Singleton

Referenced by instance().

Member Function Documentation

shared_ptr<LineWriter> ca_mgm::LogControl::getLineWriter ( ) const

Get the current LineWriter

static LogControl ca_mgm::LogControl::instance ( )
inlinestatic

Singleton access.

References LogControl().

bool ca_mgm::LogControl::isEnabledFor ( logger::LogLevel  level_r)

return true is the level_r would be logged

void ca_mgm::LogControl::logfile ( const path::PathName logfile_r)

Set path for the logfile. Permission for logfiles is set to 0640 unless an explicit mode_t value is given. An empty pathname turns off logging. "-" logs to std::err.

Exceptions
iflogfile_r is not usable.
void ca_mgm::LogControl::logfile ( const path::PathName logfile_r,
mode_t  mode_r 
)
void ca_mgm::LogControl::logNothing ( )

Turn off logging.

void ca_mgm::LogControl::logToStdErr ( )

Log to std::err.

void ca_mgm::LogControl::setLineFormater ( const shared_ptr< LineFormater > &  formater_r)

Assign a LineFormater. If you want to format loglines by yourself. NULL installs the default formater.

void ca_mgm::LogControl::setLineWriter ( const shared_ptr< LineWriter > &  writer_r)

Assign a LineWriter. If you want to log the (formated) loglines by yourself. NULL turns off logging (same as logNothing)

See Also
log::LineWriter
void ca_mgm::LogControl::setLogLevel ( logger::LogLevel  level_r)

set the new maximal log level

void ca_mgm::LogControl::setShortLineFormater ( )

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  str,
const LogControl obj 
)
friend
std::ostream & operator<< ( std::ostream &  str,
const LogControl obj 
)
related

Stream output


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