31 #ifndef _SYS_UTIL_LOGGER_H
32 #define _SYS_UTIL_LOGGER_H
96 Logger(
unsigned int = 256);
100 Logger(
const std::shared_ptr<std::ostream>& os,
unsigned int ll = 256) :
Logger(ll)
127 void add(
const std::shared_ptr<std::ostream>&);
129 void remove(
const std::shared_ptr<std::ostream>&);
148 void id(
const std::string&
id=
"");
150 std::string
id()
const;
153 void id(
unsigned int i)
155 id(std::to_string(i));
162 void timestamp(
const std::string& ts=
"");
Thread-safe stream logger.
void multiline(unsigned int max=0)
Set multiline mode.
Logger(unsigned int=256)
Create a logger with maximum line length (default 256).
void id(unsigned int i)
Set a numeric id.
void remove_clog()
Remove std::clog (buffered error) console stream.
void remove(const std::shared_ptr< std::ostream > &)
Remove shared stream.
void remove_cerr()
Remove std::cerr (unbuffered error) console stream.
Logger & operator=(const Logger &)
Copy assign logger, using original streams and settings.
void add(const std::shared_ptr< std::ostream > &)
Add a shared stream.
void timestamp_iso(bool utc_on=true)
Set iso 8601 timestamp.
std::string id() const
Get the current id string.
void add_cerr()
Add std::cerr (unbuffered error) console stream.
void timestamp_std(bool utc_on=false)
Set to a standard timestamp.
void add_clog()
Add std::clog (buffered error) console stream.
unsigned int max_line() const
Get the maximum line length.
void max_line(unsigned int)
Set the maximum line length (default is 256).
bool utc() const
Get utc mode.
unsigned int multiline() const
Get maximum number of multiline lines.
Logger(const std::shared_ptr< std::ostream > &os, unsigned int ll=256)
Create a logger with an attached stream.
void remove_cout()
Remove std::cout console stream.
bool enable() const
Is the logger enabled?
void clear()
Clear the logger and reset to defaults.
std::string timestamp() const
Get the current timestamp format.
void add_cout()
Add std::cout console stream.