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 & );
138 void logfile(
const Pathname & logfile_r );
139 void logfile(
const Pathname & logfile_r, mode_t mode_r );
156 void setLineWriter(
const shared_ptr<LineWriter> & writer_r );
171 TmpLineWriter(
const shared_ptr<LineWriter> & writer_r = shared_ptr<LineWriter>() )
180 template<
class _LineWriter>
200 std::ostream &
operator<<( std::ostream & str,
const LogControl & obj );
208 #endif // ZYPP_BASE_LOGCONTROL_H
LogControl()
Default ctor: Singleton.
LogLevel
Definition of log levels.
Base class for ostream based LineWriter.
virtual void writeOut(const std::string &formated_r)
Exchange LineWriter for the lifetime of this object.
void logfile(const Pathname &logfile_r)
Set path for the logfile.
static LogControl instance()
Singleton access.
void setLineWriter(const shared_ptr< LineWriter > &writer_r)
Assign a LineWriter.
void logToStdErr()
Log to std::err.
friend std::ostream & operator<<(std::ostream &str, const LogControl &obj)
StreamLineWriter(std::ostream &str_r)
Turn on excessive logging for the lifetime of this object.
void logNothing()
Turn off logging.
Maintain logfile related options.
log::LineWriter LineWriter
If you want to log the (formated) loglines by yourself, derive from this, and overload writeOut...
std::ostream & operator<<(std::ostream &str, const Flags< Enum > &obj)
shared_ptr< LineWriter > _writer
void setLineFormater(const shared_ptr< LineFormater > &formater_r)
Assign a LineFormater.
virtual void writeOut(const std::string &)
shared_ptr< LineWriter > getLineWriter() const
Get the current LineWriter.
TmpLineWriter(_LineWriter *_allocated_r)
Convenience ctor taking over ownership of an allocated LineWriter.
FileLineWriter(const Pathname &file_r, mode_t mode_r=0)