Goby3  3.1.5a
2024.05.23
goby::util::FlexOstream Class Reference

Forms the basis of the Goby logger: std::ostream derived class for holding the FlexOStreamBuf. More...

#include <goby/util/debug_logger/flex_ostream.h>

Inheritance diagram for goby::util::FlexOstream:

Public Member Functions

 FlexOstream ()
 
 ~FlexOstream () override=default
 
Initialization
void add_group (const std::string &name, Colors::Color color=Colors::nocolor, const std::string &description="")
 Add another group to the logger. A group provides related manipulator for categorizing log messages. More...
 
void set_name (const std::string &s)
 Set the name of the application that the logger is serving. More...
 
void enable_gui ()
 
bool is (goby::util::logger::Verbosity verbosity)
 
bool is_die ()
 
bool is_warn ()
 
bool is_verbose ()
 
bool is_debug1 ()
 
bool is_debug2 ()
 
bool is_debug3 ()
 
void add_stream (logger::Verbosity verbosity=logger::VERBOSE, std::ostream *os=nullptr)
 Attach a stream object (e.g. std::cout, std::ofstream, ...) to the logger with desired verbosity. More...
 
void add_stream (goby::util::protobuf::GLogConfig::Verbosity verbosity=goby::util::protobuf::GLogConfig::VERBOSE, std::ostream *os=nullptr)
 
void remove_stream (std::ostream *os=nullptr)
 
const FlexOStreamBufbuf ()
 
Overloaded insert stream operator<<
std::ostream & operator<< (FlexOstream &(*pf)(FlexOstream &))
 
std::ostream & operator<< (std::ostream &(*pf)(std::ostream &))
 
std::ostream & operator<< (bool &val)
 
std::ostream & operator<< (const short &val)
 
std::ostream & operator<< (const unsigned short &val)
 
std::ostream & operator<< (const int &val)
 
std::ostream & operator<< (const unsigned int &val)
 
std::ostream & operator<< (const long &val)
 
std::ostream & operator<< (const long long &val)
 
std::ostream & operator<< (const unsigned long &val)
 
std::ostream & operator<< (const float &val)
 
std::ostream & operator<< (const double &val)
 
std::ostream & operator<< (const long double &val)
 
std::ostream & operator<< (std::streambuf *sb)
 
std::ostream & operator<< (std::ios &(*pf)(std::ios &))
 
std::ostream & operator<< (std::ios_base &(*pf)(std::ios_base &))
 

Thread safety related

std::recursive_mutex & mutex ()
 Get a reference to the Goby logger mutex for scoped locking. More...
 
void set_lock_action (logger_lock::LockAction lock_action)
 
void refresh ()
 
void set_group (const std::string &s)
 
std::ostream & operator<< (FlexOstream &out, char c)
 
std::ostream & operator<< (FlexOstream &out, signed char c)
 
std::ostream & operator<< (FlexOstream &out, unsigned char c)
 
std::ostream & operator<< (FlexOstream &out, const char *s)
 
std::ostream & operator<< (FlexOstream &out, const signed char *s)
 
std::ostream & operator<< (FlexOstream &out, const unsigned char *s)
 

Detailed Description

Forms the basis of the Goby logger: std::ostream derived class for holding the FlexOStreamBuf.

Definition at line 43 of file flex_ostream.h.

Constructor & Destructor Documentation

◆ FlexOstream()

goby::util::FlexOstream::FlexOstream ( )
inline

Definition at line 46 of file flex_ostream.h.

◆ ~FlexOstream()

goby::util::FlexOstream::~FlexOstream ( )
overridedefault

Member Function Documentation

◆ add_group()

void goby::util::FlexOstream::add_group ( const std::string &  name,
Colors::Color  color = Colors::nocolor,
const std::string &  description = "" 
)

Add another group to the logger. A group provides related manipulator for categorizing log messages.

◆ add_stream() [1/2]

void goby::util::FlexOstream::add_stream ( goby::util::protobuf::GLogConfig::Verbosity  verbosity = goby::util::protobuf::GLogConfig::VERBOSE,
std::ostream *  os = nullptr 
)
inline

Definition at line 95 of file flex_ostream.h.

◆ add_stream() [2/2]

void goby::util::FlexOstream::add_stream ( logger::Verbosity  verbosity = logger::VERBOSE,
std::ostream *  os = nullptr 
)
inline

Attach a stream object (e.g. std::cout, std::ofstream, ...) to the logger with desired verbosity.

Definition at line 89 of file flex_ostream.h.

◆ buf()

const FlexOStreamBuf& goby::util::FlexOstream::buf ( )
inline

Definition at line 109 of file flex_ostream.h.

◆ enable_gui()

void goby::util::FlexOstream::enable_gui ( )
inline

Definition at line 73 of file flex_ostream.h.

◆ is()

bool goby::util::FlexOstream::is ( goby::util::logger::Verbosity  verbosity)

◆ is_debug1()

bool goby::util::FlexOstream::is_debug1 ( )
inline

Definition at line 84 of file flex_ostream.h.

◆ is_debug2()

bool goby::util::FlexOstream::is_debug2 ( )
inline

Definition at line 85 of file flex_ostream.h.

◆ is_debug3()

bool goby::util::FlexOstream::is_debug3 ( )
inline

Definition at line 86 of file flex_ostream.h.

◆ is_die()

bool goby::util::FlexOstream::is_die ( )
inline

Definition at line 81 of file flex_ostream.h.

◆ is_verbose()

bool goby::util::FlexOstream::is_verbose ( )
inline

Definition at line 83 of file flex_ostream.h.

◆ is_warn()

bool goby::util::FlexOstream::is_warn ( )
inline

Definition at line 82 of file flex_ostream.h.

◆ mutex()

std::recursive_mutex& goby::util::FlexOstream::mutex ( )
inline

Get a reference to the Goby logger mutex for scoped locking.

Definition at line 145 of file flex_ostream.h.

◆ operator<<() [1/16]

std::ostream& goby::util::FlexOstream::operator<< ( bool val)
inline

Definition at line 122 of file flex_ostream.h.

◆ operator<<() [2/16]

std::ostream& goby::util::FlexOstream::operator<< ( const double val)
inline

Definition at line 131 of file flex_ostream.h.

◆ operator<<() [3/16]

std::ostream& goby::util::FlexOstream::operator<< ( const float &  val)
inline

Definition at line 130 of file flex_ostream.h.

◆ operator<<() [4/16]

std::ostream& goby::util::FlexOstream::operator<< ( const int val)
inline

Definition at line 125 of file flex_ostream.h.

◆ operator<<() [5/16]

std::ostream& goby::util::FlexOstream::operator<< ( const long &  val)
inline

Definition at line 127 of file flex_ostream.h.

◆ operator<<() [6/16]

std::ostream& goby::util::FlexOstream::operator<< ( const long double val)
inline

Definition at line 132 of file flex_ostream.h.

◆ operator<<() [7/16]

std::ostream& goby::util::FlexOstream::operator<< ( const long long &  val)
inline

Definition at line 128 of file flex_ostream.h.

◆ operator<<() [8/16]

std::ostream& goby::util::FlexOstream::operator<< ( const short &  val)
inline

Definition at line 123 of file flex_ostream.h.

◆ operator<<() [9/16]

std::ostream& goby::util::FlexOstream::operator<< ( const unsigned int val)
inline

Definition at line 126 of file flex_ostream.h.

◆ operator<<() [10/16]

std::ostream& goby::util::FlexOstream::operator<< ( const unsigned long &  val)
inline

Definition at line 129 of file flex_ostream.h.

◆ operator<<() [11/16]

std::ostream& goby::util::FlexOstream::operator<< ( const unsigned short &  val)
inline

Definition at line 124 of file flex_ostream.h.

◆ operator<<() [12/16]

std::ostream& goby::util::FlexOstream::operator<< ( FlexOstream &(*)(FlexOstream &)  pf)

◆ operator<<() [13/16]

std::ostream& goby::util::FlexOstream::operator<< ( std::ios &(*)(std::ios &)  pf)
inline

Definition at line 134 of file flex_ostream.h.

◆ operator<<() [14/16]

std::ostream& goby::util::FlexOstream::operator<< ( std::ios_base &(*)(std::ios_base &)  pf)
inline

Definition at line 135 of file flex_ostream.h.

◆ operator<<() [15/16]

std::ostream& goby::util::FlexOstream::operator<< ( std::ostream &(*)(std::ostream &)  pf)

◆ operator<<() [16/16]

std::ostream& goby::util::FlexOstream::operator<< ( std::streambuf *  sb)
inline

Definition at line 133 of file flex_ostream.h.

◆ refresh()

void goby::util::FlexOstream::refresh ( )
inline

Definition at line 150 of file flex_ostream.h.

◆ remove_stream()

void goby::util::FlexOstream::remove_stream ( std::ostream *  os = nullptr)
inline

Definition at line 103 of file flex_ostream.h.

◆ set_group()

void goby::util::FlexOstream::set_group ( const std::string &  s)
inline

Definition at line 151 of file flex_ostream.h.

◆ set_lock_action()

void goby::util::FlexOstream::set_lock_action ( logger_lock::LockAction  lock_action)
inline

Definition at line 147 of file flex_ostream.h.

◆ set_name()

void goby::util::FlexOstream::set_name ( const std::string &  s)
inline

Set the name of the application that the logger is serving.

Definition at line 67 of file flex_ostream.h.

Friends And Related Function Documentation

◆ operator<< [1/6]

std::ostream& operator<< ( FlexOstream out,
char  c 
)
friend

Definition at line 180 of file flex_ostream.h.

◆ operator<< [2/6]

std::ostream& operator<< ( FlexOstream out,
const char s 
)
friend

Definition at line 186 of file flex_ostream.h.

◆ operator<< [3/6]

std::ostream& operator<< ( FlexOstream out,
const signed char s 
)
friend

Definition at line 187 of file flex_ostream.h.

◆ operator<< [4/6]

std::ostream& operator<< ( FlexOstream out,
const unsigned char s 
)
friend

Definition at line 191 of file flex_ostream.h.

◆ operator<< [5/6]

std::ostream& operator<< ( FlexOstream out,
signed char  c 
)
friend

Definition at line 181 of file flex_ostream.h.

◆ operator<< [6/6]

std::ostream& operator<< ( FlexOstream out,
unsigned char  c 
)
friend

Definition at line 182 of file flex_ostream.h.


The documentation for this class was generated from the following file: