gz/common/Console.hh
Go to the documentation of this file.
160 };
Container for loggers, and global logging options (such as verbose vs. quiet output).
Definition: gz/common/Console.hh:239
static Logger dbg
Global instance of the debug logger.
Definition: gz/common/Console.hh:281
static std::string Prefix()
Get custom prefix. This is empty by default.
static void SetVerbosity(const int _level)
Set verbosity, where <= 0: No output, 1: Error messages, 2: Error and warning messages,...
static FileLogger log
Global instance of the file logger.
Definition: gz/common/Console.hh:287
static Logger err
Global instance of the error logger.
Definition: gz/common/Console.hh:278
static void SetPrefix(const std::string &_customPrefix)
Add a custom prefix in front of the default prefixes.
static Logger warn
Global instance of the warning logger.
Definition: gz/common/Console.hh:284
static Logger msg
Global instance of the message logger.
Definition: gz/common/Console.hh:275
String buffer for the file logger.
Definition: gz/common/Console.hh:109
std::streamsize xsputn(const char *_char, std::streamsize _count) override
Writes _count characters to the string buffer.
int sync() override
Sync the stream (output the string buffer contents).
std::ofstream * stream
Stream to output information into.
Definition: gz/common/Console.hh:130
A logger that outputs messages to a file.
Definition: gz/common/Console.hh:71
virtual FileLogger & operator()()
Output a filename and line number, then return a reference to the logger.
std::string LogDirectory() const
Get the full path of the directory where all the log files are stored.
virtual FileLogger & operator()(const std::string &_file, int _line)
Output a filename and line number, then return a reference to the logger.
void Init(const std::string &_directory, const std::string &_filename)
Initialize the file logger.
String buffer for the base logger.
Definition: gz/common/Console.hh:187
std::streamsize xsputn(const char *_char, std::streamsize _count) override
Writes _count characters to the string buffer.
int color
ANSI color code using Select Graphic Rendition parameters (SGR). See http://en.wikipedia....
Definition: gz/common/Console.hh:217
LogType type
Destination type for the messages.
Definition: gz/common/Console.hh:212
int verbosity
Level of verbosity.
Definition: gz/common/Console.hh:220
int sync() override
Sync the stream (output the string buffer contents).
Buffer(LogType _type, const int _color, const int _verbosity)
Constructor.
virtual Logger & operator()(const std::string &_file, int _line)
Output a filename and line number, then return a reference to the logger.
Logger(const std::string &_prefix, const int _color, const LogType _type, const int _verbosity)
Constructor.
LogType
Output destination type.
Definition: gz/common/Console.hh:155
#define IGN_COMMON_WARN_IGNORE__DLL_INTERFACE_MISSING
Microsoft Visual Studio does not automatically export the interface information for member variables ...
Definition: gz/common/SuppressWarning.hh:65
#define IGN_COMMON_WARN_RESUME__DLL_INTERFACE_MISSING
Definition: gz/common/SuppressWarning.hh:68
Forward declarations for the common classes.