libzypp  17.25.10
zypp::base::LogControl Class Reference

Maintain logfile related options. More...

#include <LogControl.h>


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. More...
void logfile (const Pathname &logfile_r)
 Set path for the logfile. More...
void logfile (const Pathname &logfile_r, mode_t mode_r)
void logNothing ()
 Turn off logging. More...
void logToStdErr ()
 Log to std::err. More...
shared_ptr< LineWritergetLineWriter () const
 Get the current LineWriter. More...
void setLineWriter (const shared_ptr< LineWriter > &writer_r)
 Assign a LineWriter. More...

Static Public Member Functions

static LogControl instance ()
 Singleton access. More...

Private Member Functions

 LogControl ()
 Default ctor: Singleton. More...


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)
 Stream output. More...

Detailed Description

Maintain logfile related options.

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

Definition at line 96 of file LogControl.h.

Member Typedef Documentation

◆ LineWriter

Constructor & Destructor Documentation

◆ LogControl()

zypp::base::LogControl::LogControl ( )

Default ctor: Singleton.

Definition at line 195 of file LogControl.h.

Member Function Documentation

◆ instance()

static LogControl zypp::base::LogControl::instance ( )

Singleton access.

Definition at line 102 of file LogControl.h.

◆ setLineFormater()

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 480 of file

◆ logfile() [1/2]

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.

iflogfile_r is not usable.

Definition at line 468 of file

◆ logfile() [2/2]

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

Definition at line 471 of file

◆ logNothing()

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

Turn off logging.

Definition at line 483 of file

◆ logToStdErr()

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

Log to std::err.

Definition at line 486 of file

◆ getLineWriter()

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

Get the current LineWriter.

Definition at line 474 of file

◆ setLineWriter()

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

Definition at line 477 of file

Friends And Related Function Documentation

◆ operator<< [1/2]

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

Definition at line 504 of file

◆ operator<<() [2/2]

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

Stream output.

Definition at line 504 of file

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