UNISTDX_BASE_LOG_MESSAGE
class sys::log_message

Write formatted log message.

  • The message is buffered, so it is safe to use this class in multi-threaded programme.
  • Message arguments are inserted using their output operators.
  • Insertion location is determined by underscore, or spec character.
  • Every message is prefixed by abstract name. It can be object name, class name or any other identified that distinguishes message origin.
  • Message names are right-aligned which makes log look like chat, where different subsystems talk to each other.
  • Message is logged in destructor.

Methods
  • out() -> std::ostream &

    Access log message stream.

  • ~log_message()

    Append newline character and flush the stream.

  • template <class ... Args>
    log_message(const char * name, char spec = '_')explicit

    Create log message. Create log message with name name, argument marker spec, that will be sent to standard error stream when destructor is called.

    Date
    2018-06-05
  • template <class ... Args>
    log_message(const char * name, char spec, const char * fmt, const Args &... tokens)explicit

    Create log message. Create log message with name name, argument marker spec, formatted text fmt, and arguments tokens, that will be sent to standard error stream when destructor is called.

    Date
    2018-05-22
  • template <class ... Args>
    log_message(const char * name, const char * fmt, const Args &... tokens)explicit

    Create log message. Create log message with name name, argument marker '_', formatted text fmt, and arguments tokens, that will be sent to standard error stream when destructor is called.

    Date
    2018-05-22