Ion
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
logging_cerr.cc
Go to the documentation of this file.
1 
18 #include "ion/port/logging.h"
19 
20 #include <iostream> // NOLINT
21 
22 namespace {
23 
24 class CerrLogEntryWriter : public ion::port::LogEntryWriter {
25  public:
26  CerrLogEntryWriter() {}
27  ~CerrLogEntryWriter() override {}
28 
30  void Write(ion::port::LogSeverity severity,
31  const std::string& message) override {
32  std::cerr << GetSeverityName(severity) << " " << message << "\n";
33  }
34 };
35 
36 } // namespace
37 
39  return new CerrLogEntryWriter();
40 }
Abstract class which can be overridden to integrate Ion logging with other logging systems...
Definition: logging.h:36
LogSeverity
Definition: logging.h:26
virtual void Write(LogSeverity severity, const std::string &message)=0
const char * GetSeverityName(LogSeverity severity) const
Convenient way to map a severity-code to a printable represenation.
Definition: logging.cc:24
ION_API LogEntryWriter * CreateDefaultLogEntryWriter()
Instantiate a new LogEntryWriter of the default type for the current platform...