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> 48 virtual void writeOut(
const std::string & formated_r )
49 { (*_str) << formated_r << std::endl; }
116 virtual std::string
format(
const std::string & ,
121 const std::string & );
167 void setLineWriter(
const shared_ptr<LineWriter> & writer_r );
182 TmpLineWriter(
const shared_ptr<LineWriter> & writer_r = shared_ptr<LineWriter>() )
191 template<
class TLineWriter>
211 std::ostream &
operator<<( std::ostream &
str,
const LogControl & obj );
219 #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.
std::ostream & operator<<(std::ostream &str, const Flags< TEnum > &obj)
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.
static void notifyFork()
This will completely disable logging, its supposed to be called in the child process after fork() was...
shared_ptr< LineWriter > getLineWriter() const
Get the current LineWriter.
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
void setLineFormater(const shared_ptr< LineFormater > &formater_r)
Assign a LineFormater.
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.
void emergencyShutdown()
will cause the log thread to exit and flush all sockets
FileLineWriter(const Pathname &file_r, mode_t mode_r=0)