21 #ifndef G_LOG_OUTPUT_H
22 #define G_LOG_OUTPUT_H
46 LogOutput(
const std::string & prefix ,
bool output ,
bool with_logging ,
47 bool with_verbose_logging ,
bool with_debug ,
bool with_level ,
48 bool with_timestamp ,
bool strip_context ,
bool use_syslog ,
49 const std::string & stderr_replacement = std::string() ,
63 explicit LogOutput(
bool output_with_logging ,
bool verbose_and_debug =
true ,
64 const std::string & stderr_replacement = std::string() ) ;
79 bool enable(
bool enabled =
true ) ;
86 static void assertion(
const char * file ,
int line ,
bool test ,
const std::string & ) ;
96 typedef size_t size_type ;
101 std::string timestampString() ;
102 static std::string dateString() ;
104 void doOutput(
G::Log::Severity s ,
const char * ,
int ,
const std::string & ) ;
105 void doAssertion(
const char * ,
int ,
const std::string & ) ;
107 static std::string itoa(
int ) ;
108 static std::string fileAndLine(
const char * ,
int ) ;
111 static std::ostream & err(
const std::string & ) ;
112 static void getLocalTime( time_t ,
struct std::tm * ) ;
115 std::string m_prefix ;
123 std::ostream & m_std_err ;
126 char m_time_buffer[40U] ;
bool enable(bool enabled=true)
Enables or disables output. Returns the previous setting.
static LogOutput * instance()
Returns a pointer to the controlling LogOutput object.
LogOutput(const std::string &prefix, bool output, bool with_logging, bool with_verbose_logging, bool with_debug, bool with_level, bool with_timestamp, bool strip_context, bool use_syslog, const std::string &stderr_replacement=std::string(), SyslogFacility syslog_facility=User)
Constructor.
static void assertion(const char *file, int line, bool test, const std::string &)
Makes an assertion check (regardless of any LogOutput object).
virtual void onAssert()
Called during an assertion failure.
virtual void rawOutput(std::ostream &, G::Log::Severity, const std::string &)
Overridable.
virtual ~LogOutput()
Destructor.
static void output(G::Log::Severity, const char *file, int line, const std::string &)
Generates output if there is an existing LogOutput object which is enabled.
Controls and implements low-level logging output, as used by the Log interface.