Slog#

namespace slog#

Variables

static constexpr LogStreamEndLine endl#
static constexpr LogStreamBoolAlpha boolalpha#
static LogStream info ("INFO", std::cout)
static LogStream debug ("DEBUG", std::cout)
static LogStream warn ("WARNING", std::cout)
static LogStream err ("ERROR", std::cerr)
class LogStream#
#include <slog.hpp>

The LogStream class implements a stream for sample logging.

Public Functions

inline LogStream(const std::string &prefix, std::ostream &log_stream)#

A constructor. Creates a LogStream object.

Parameters:

prefix – The prefix to print

template<class T>
inline LogStream &operator<<(const T &arg)#

A stream output operator to be used within the logger.

Parameters:

arg – Object for serialization in the logger message

inline LogStream &operator<<(const LogStreamEndLine&)#
inline LogStream &operator<<(const LogStreamBoolAlpha&)#
template<template<class, class> class Container, class T>
inline LogStream &operator<<(const Container<T, std::allocator<T>> &container)#

Private Members

std::string _prefix#
std::ostream *_log_stream#
bool _new_line#
class LogStreamBoolAlpha#
#include <slog.hpp>

The LogStreamBoolAlpha class implements bool printing for a log stream.

class LogStreamEndLine#
#include <slog.hpp>

The LogStreamEndLine class implements an end line marker for a log stream.