12 #ifndef ZYPP_BASE_LOGCONTROL_H 13 #define ZYPP_BASE_LOGCONTROL_H 47 virtual void writeOut(
const std::string & formated_r )
48 { (*_str) << formated_r << std::endl; }
115 virtual std::string format(
const std::string & ,
120 const std::string & );
129 void setLineFormater(
const shared_ptr<LineFormater> & formater_r );
138 void logfile(
const Pathname & logfile_r );
139 void logfile(
const Pathname & logfile_r, mode_t mode_r );
149 shared_ptr<LineWriter> getLineWriter()
const;
156 void setLineWriter(
const shared_ptr<LineWriter> & writer_r );
171 TmpLineWriter(
const shared_ptr<LineWriter> & writer_r = shared_ptr<LineWriter>() )
172 : _writer(
LogControl::instance().getLineWriter() )
173 { LogControl::instance().setLineWriter( writer_r ); }
180 template<
class TLineWriter>
182 : _writer(
LogControl::instance().getLineWriter() )
183 { LogControl::instance().setLineWriter( shared_ptr<LineWriter>( _allocated_r ) ); }
186 { LogControl::instance().setLineWriter( _writer ); }
208 #endif // ZYPP_BASE_LOGCONTROL_H LogControl()
Default ctor: Singleton.
LogLevel
Definition of log levels.
Base class for ostream based LineWriter.
String related utilities and Regular expression matching.
virtual void writeOut(const std::string &formated_r)
Exchange LineWriter for the lifetime of this object.
static LogControl instance()
Singleton access.
std::ostream & operator<<(std::ostream &str, const Exception &obj)
StreamLineWriter(std::ostream &str_r)
Turn on excessive logging for the lifetime of this object.
Maintain logfile related options.
log::LineWriter LineWriter
If you want to log the (formated) loglines by yourself, derive from this, and overload writeOut...
TmpLineWriter(TLineWriter *_allocated_r)
Convenience ctor taking over ownership of an allocated LineWriter.
shared_ptr< LineWriter > _writer
TmpLineWriter(const shared_ptr< LineWriter > &writer_r=shared_ptr< LineWriter >())
virtual void writeOut(const std::string &)
Easy-to use interface to the ZYPP dependency resolver.