12#ifndef ZYPP_BASE_LOGCONTROL_H
13#define ZYPP_BASE_LOGCONTROL_H
48 void writeOut(
const std::string & formated_r )
override
49 { (*_str) << formated_r << std::endl; }
116 virtual std::string
format(
const std::string & ,
121 const std::string & );
130 std::string
format(
const std::string & ,
135 const std::string & )
override;
214 template<
class TLineWriter>
friend std::ostream & operator<<(std::ostream &str, const LogControl &obj)
LogControl()
Default ctor: Singleton.
shared_ptr< LineWriter > getLineWriter() const
Get the current LineWriter.
void setLineWriter(const shared_ptr< LineWriter > &writer_r)
Assign a LineWriter.
void logToStdErr()
Log to std::err.
void logRawLine(std::string &&line)
will push a line to the logthread without formatting it
log::LineWriter LineWriter
void logNothing()
Turn off logging.
static void notifyFork()
This will completely disable logging.
void setLineFormater(const shared_ptr< LineFormater > &formater_r)
Assign a LineFormater.
static LogControl instance()
Singleton access.
void enableLogForwardingMode(bool enable=true)
void logfile(const Pathname &logfile_r)
Set path for the logfile.
void emergencyShutdown()
will cause the log thread to exit and flush all sockets
String related utilities and Regular expression matching.
LogLevel
Definition of log levels.
std::ostream & operator<<(std::ostream &str, const Flags< TEnum > &obj)
TmpLineWriter(const shared_ptr< LineWriter > &writer_r=shared_ptr< LineWriter >())
shared_ptr< LineWriter > _writer
TmpLineWriter(TLineWriter *_allocated_r)
Convenience ctor taking over ownership of an allocated LineWriter.
FileLineWriter(const Pathname &file_r, mode_t mode_r=0)
If you want to log the (formated) loglines by yourself, derive from this, and overload writeOut.
virtual void writeOut(const std::string &)
StreamLineWriter(std::ostream &str_r)
void writeOut(const std::string &formated_r) override