LogIt++
Header-only, macro-first C++ logging library
Loading...
Searching...
No Matches
ConsoleStreamRoute.hpp
Go to the documentation of this file.
1#pragma once
2#ifndef LOGIT_CPP_HEADER_LOGIT_CPP_LOGIT_LOGGERS_CONSOLELOGGER_CONSOLESTREAMROUTE_HPP_INCLUDED
3#define LOGIT_CPP_HEADER_LOGIT_CPP_LOGIT_LOGGERS_CONSOLELOGGER_CONSOLESTREAMROUTE_HPP_INCLUDED
4
7
8#include <ostream>
9
10namespace logit {
11
14 enum class ConsoleStreamKind {
15 Cout,
16 Cerr,
17 Custom
18 };
19
59
60} // namespace logit
61
62#endif // LOGIT_CPP_HEADER_LOGIT_CPP_LOGIT_LOGGERS_CONSOLELOGGER_CONSOLESTREAMROUTE_HPP_INCLUDED
The primary namespace for the LogIt++ library.
LogLevel
Logging levels.
Definition enums.hpp:15
@ LOG_LVL_TRACE
Trace level logging.
@ LOG_LVL_FATAL
Fatal level logging.
ConsoleStreamKind
Identifies a target output stream for ConsoleLogger routes.
@ Cout
Routes records to std::cout.
@ Custom
Routes records to a caller-provided std::ostream pointer.
@ Cerr
Routes records to std::cerr.
Maps a log-level range to a target output stream.
LogLevel min_level
Inclusive lower bound.
static ConsoleStreamRoute to_cerr(LogLevel min_level, LogLevel max_level)
Builds a route that targets std::cerr for the given level range.
static ConsoleStreamRoute to_cout(LogLevel min_level, LogLevel max_level)
Builds a route that targets std::cout for the given level range.
LogLevel max_level
Inclusive upper bound.
static ConsoleStreamRoute to_stream(LogLevel min_level, LogLevel max_level, std::ostream &stream)
Builds a route that targets a caller-provided std::ostream for the given level range.
std::ostream * custom_stream
Used when kind == Custom; null is ignored and the route falls back.
ConsoleStreamKind kind
Stream identifier.