Loading...
Searching...
No Matches
globjects::LogMessageBuilder Class Reference

Builds a LogMessage from different kinds of primitive types. More...

`#include <globjects/include/globjects/base/LogMessageBuilder.h>`

## Public Types

using | PrecisionManipulator = decltype(std::setprecision(0))
using | FillManipulator = decltype(std::setfill( '0'))
using | WidthManipulator = decltype(std::setw(0))

## Public Member Functions

| LogMessageBuilder (LogMessageLevel level, AbstractLogHandler *handler)
| LogMessageBuilder (const LogMessageBuilder &builder)
virtual | ~LogMessageBuilder ()
LogMessageBuilder & | operator<< (const char *c)
LogMessageBuilder & | operator<< (const std::string &str)
LogMessageBuilder & | operator<< (bool b)
LogMessageBuilder & | operator<< (char c)
LogMessageBuilder & | operator<< (int i)
LogMessageBuilder & | operator<< (float f)
LogMessageBuilder & | operator<< (double d)
LogMessageBuilder & | operator<< (long double d)
LogMessageBuilder & | operator<< (unsigned u)
LogMessageBuilder & | operator<< (long l)
LogMessageBuilder & | operator<< (long long l)
LogMessageBuilder & | operator<< (unsigned long ul)
LogMessageBuilder & | operator<< (unsigned char uc)
LogMessageBuilder & | operator<< (const void *pointer)
LogMessageBuilder & | operator<< (std::ostream &(*manipulator)(std::ostream &))
LogMessageBuilder & | operator<< (PrecisionManipulator manipulator)
LogMessageBuilder & | operator<< (FillManipulator manipulator)
LogMessageBuilder & | operator<< (WidthManipulator manipulator)
template<typename T >
LogMessageBuilder & | operator<< (const ref_ptr< T > &ref_pointer)
template<typename T >
LogMessageBuilder & | operator<< (const T *pointer)
template<typename T >
LogMessageBuilder & | operator<< (const std::vector< T > &vector)
template<typename T , std::size_t Count>
LogMessageBuilder & | operator<< (const std::array< T, Count > &array)

## Protected Attributes

LogMessageLevel | m_level
AbstractLogHandler * | m_handler
std::shared_ptr< std::stringstream > | m_stream

## Detailed Description

Builds a LogMessage from different kinds of primitive types.

The LogMessageBuilder is usually created by one of the global functions log, debug, warning, error or fatal. It works similar to streams and accepts a number of different types which will be converted to strings automatically. When it goes out of scope, it creates a LogMessage from all streamed objects and sends it to the log handler.

Typical usage of the LogMessageBuilder:

warning() << "This is warning number " << 3;
globjects::warning
GLOBJECTS_API LogMessageBuilder warning()

See also
  logging.h
  LogMessage
  setLoggingHandler
  setVerbosityLevel
  info
  debug
  warning
  critical

## Member Typedef Documentation

## PrecisionManipulator

using globjects::LogMessageBuilder::PrecisionManipulator = decltype(std::setprecision(0))

## FillManipulator

using globjects::LogMessageBuilder::FillManipulator = decltype(std::setfill('0'))

## WidthManipulator

using globjects::LogMessageBuilder::WidthManipulator = decltype(std::setw(0))

## Constructor & Destructor Documentation

## LogMessageBuilder() [1/2]

globjects::LogMessageBuilder::LogMessageBuilder | ( | LogMessageLevel | level,
|  | AbstractLogHandler * | handler
| ) |  |

## LogMessageBuilder() [2/2]

globjects::LogMessageBuilder::LogMessageBuilder | ( | const LogMessageBuilder & | builder | ) |

## ~LogMessageBuilder()

virtual globjects::LogMessageBuilder::~LogMessageBuilder | ( |  | ) |

virtual

## Member Function Documentation

## operator<<() [1/22]

LogMessageBuilder & globjects::LogMessageBuilder::operator<< | ( | const char * | c | ) |

## operator<<() [2/22]

LogMessageBuilder & globjects::LogMessageBuilder::operator<< | ( | const std::string & | str | ) |

## operator<<() [3/22]

LogMessageBuilder & globjects::LogMessageBuilder::operator<< | ( | bool | b | ) |

## operator<<() [4/22]

LogMessageBuilder & globjects::LogMessageBuilder::operator<< | ( | char | c | ) |

## operator<<() [5/22]

LogMessageBuilder & globjects::LogMessageBuilder::operator<< | ( | int | i | ) |

## operator<<() [6/22]

LogMessageBuilder & globjects::LogMessageBuilder::operator<< | ( | float | f | ) |

## operator<<() [7/22]

LogMessageBuilder & globjects::LogMessageBuilder::operator<< | ( | double | d | ) |

## operator<<() [8/22]

LogMessageBuilder & globjects::LogMessageBuilder::operator<< | ( | long double | d | ) |

## operator<<() [9/22]

LogMessageBuilder & globjects::LogMessageBuilder::operator<< | ( | unsigned | u | ) |

## operator<<() [10/22]

LogMessageBuilder & globjects::LogMessageBuilder::operator<< | ( | long | l | ) |

## operator<<() [11/22]

LogMessageBuilder & globjects::LogMessageBuilder::operator<< | ( | long long | l | ) |

## operator<<() [12/22]

LogMessageBuilder & globjects::LogMessageBuilder::operator<< | ( | unsigned long | ul | ) |

## operator<<() [13/22]

LogMessageBuilder & globjects::LogMessageBuilder::operator<< | ( | unsigned char | uc | ) |

## operator<<() [14/22]

LogMessageBuilder & globjects::LogMessageBuilder::operator<< | ( | const void * | pointer | ) |

## operator<<() [15/22]

LogMessageBuilder & globjects::LogMessageBuilder::operator<< | ( | std::ostream &(*)(std::ostream &) | manipulator | ) |

## operator<<() [16/22]

LogMessageBuilder & globjects::LogMessageBuilder::operator<< | ( | PrecisionManipulator | manipulator | ) |

## operator<<() [17/22]

LogMessageBuilder & globjects::LogMessageBuilder::operator<< | ( | FillManipulator | manipulator | ) |

## operator<<() [18/22]

LogMessageBuilder & globjects::LogMessageBuilder::operator<< | ( | WidthManipulator | manipulator | ) |

## operator<<() [19/22]

template<typename T >

LogMessageBuilder & globjects::LogMessageBuilder::operator<< | ( | const ref_ptr< T > & | ref_pointer | ) |

## operator<<() [20/22]

template<typename T >

LogMessageBuilder & globjects::LogMessageBuilder::operator<< | ( | const T * | pointer | ) |

## operator<<() [21/22]

template<typename T >

LogMessageBuilder & globjects::LogMessageBuilder::operator<< | ( | const std::vector< T > & | vector | ) |

## operator<<() [22/22]

template<typename T , std::size_t Count>

LogMessageBuilder & globjects::LogMessageBuilder::operator<< | ( | const std::array< T, Count > & | array | ) |

## Member Data Documentation

## m_level

LogMessageLevel globjects::LogMessageBuilder::m_level

protected

## m_handler

AbstractLogHandler* globjects::LogMessageBuilder::m_handler

protected

## m_stream

std::shared_ptr<std::stringstream> globjects::LogMessageBuilder::m_stream

protected

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

- LogMessageBuilder.h