zypp::base::LogControl Class Reference

Maintain logfile related options. More...

#include <LogControl.h>

List of all members.

Classes

struct  LineFormater
 If you want to format loglines by yourself, derive from this, and overload format. More...
struct  TmpExcessive
 Turn on excessive logging for the lifetime of this object. More...
struct  TmpLineWriter
 Exchange LineWriter for the lifetime of this object. More...

Public Types

typedef log::LineWriter LineWriter

Public Member Functions

void setLineFormater (const shared_ptr< LineFormater > &formater_r)
 Assign a LineFormater.
void logfile (const Pathname &logfile_r)
 Set path for the logfile.
void logfile (const Pathname &logfile_r, mode_t mode_r)
void logNothing ()
 Turn off logging.
void logToStdErr ()
 Log to std::err.
shared_ptr< LineWritergetLineWriter () const
 Get the current LineWriter.
void setLineWriter (const shared_ptr< LineWriter > &writer_r)
 Assign a LineWriter.

Static Public Member Functions

static LogControl instance ()
 Singleton access.

Private Member Functions

 LogControl ()
 Default ctor: Singleton.

Friends

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.

Definition at line 95 of file LogControl.h.


Member Typedef Documentation

See also:
log::LineWriter

Definition at line 106 of file LogControl.h.


Constructor & Destructor Documentation

zypp::base::LogControl::LogControl (  )  [inline, private]

Default ctor: Singleton.

Definition at line 194 of file LogControl.h.

Referenced by instance().


Member Function Documentation

static LogControl zypp::base::LogControl::instance (  )  [inline, static]

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

Assign a LineFormater.

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

Definition at line 412 of file LogControl.cc.

References instance(), and setLineFormater().

Referenced by zypp::base::logger::LogControlImpl::LogControlImpl(), and setLineFormater().

void zypp::base::LogControl::logfile ( const 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:
if logfile_r is not usable.

Definition at line 400 of file LogControl.cc.

References instance(), and logfile().

Referenced by zypp::base::logger::LogControlImpl::LogControlImpl(), and logfile().

void zypp::base::LogControl::logfile ( const Pathname &  logfile_r,
mode_t  mode_r 
)

Definition at line 403 of file LogControl.cc.

References instance(), and logfile().

void zypp::base::LogControl::logNothing (  ) 

Turn off logging.

Definition at line 415 of file LogControl.cc.

References instance(), and setLineWriter().

void zypp::base::LogControl::logToStdErr (  ) 

Log to std::err.

Definition at line 418 of file LogControl.cc.

References instance(), and setLineWriter().

shared_ptr< LogControl::LineWriter > zypp::base::LogControl::getLineWriter (  )  const

Get the current LineWriter.

Definition at line 406 of file LogControl.cc.

References getLineWriter(), and instance().

Referenced by getLineWriter().

void zypp::base::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

Definition at line 409 of file LogControl.cc.

References instance(), and setLineWriter().

Referenced by zypp::base::logger::LogControlImpl::logfile(), logNothing(), logToStdErr(), setLineWriter(), zypp::base::LogControl::TmpLineWriter::TmpLineWriter(), and zypp::base::LogControl::TmpLineWriter::~TmpLineWriter().


Friends And Related Function Documentation

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

Stream output

Definition at line 436 of file LogControl.cc.


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

doxygen