12#ifndef ZYPP_BASE_LOGCONTROL_H
13#define ZYPP_BASE_LOGCONTROL_H
18#include <zypp-core/base/Logger.h>
19#include <zypp-core/base/PtrTypes.h>
20#include <zypp-core/Pathname.h>
37 virtual void writeOut(
const std::string & )
44 struct StreamLineWriter :
public LineWriter
48 virtual void writeOut(
const std::string & formated_r )
49 { (*_str) << formated_r << std::endl; }
57 struct StdoutLineWriter :
public StreamLineWriter
63 struct StderrLineWriter :
public StreamLineWriter
72 struct FileLineWriter :
public StreamLineWriter
116 virtual std::string
format(
const std::string & ,
121 const std::string & );
146 void logfile(
const Pathname & logfile_r );
147 void logfile(
const Pathname & logfile_r, mode_t mode_r );
201 template<
class TLineWriter>
221 std::ostream &
operator<<( std::ostream &
str,
const LogControl & obj );
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 emergencyShutdown()
will cause the log thread to exit and flush all sockets
void logToStdErr()
Log to std::err.
void logRawLine(std::string &&line)
will push a line to the logthread without formatting it
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.
log::LineWriter LineWriter
String related utilities and Regular expression matching.
LogLevel
Definition of log levels.
std::ostream & operator<<(std::ostream &str, const Flags< TEnum > &obj)
Easy-to use interface to the ZYPP dependency resolver.
TmpLineWriter(const shared_ptr< LineWriter > &writer_r=shared_ptr< LineWriter >())
shared_ptr< LineWriter > _writer
FileLineWriter(const Pathname &file_r, mode_t mode_r=0)
virtual void writeOut(const std::string &)
virtual void writeOut(const std::string &formated_r)