22 inline std::ostream&
operator <<(std::ostream& out, Channel lvl)
24 constexpr
const char* str[] = {
"standard",
"network",
"stats" };
25 out << str[static_cast<std::size_t>(lvl)];
38 inline auto gLog = makeLogger<Logger_t>(
gCore, SevLvl::info, Channel::standard);
46 wrappedSink->setFilter(makeChannelFilterFor<Record_t>(
Equals{ Channel::network }));
48 wrappedSink->setFormatter(
51 std::stringstream out;
52 out << record.channel() <<
" >> " << record.message();
53 return std::move(out).str();
63 gLog() <<
"Hello, World!";
64 gLog() <<
SetChan(Channel::network) <<
"Hello, Network!";
Convenience class for generating Record s.
Definition: Logger.hpp:84
A collection of logging related information.
Definition: Record.hpp:227
Sink class for directly logging onto std::cout.
Definition: ConsoleSink.hpp:239
The central point of the whole library. Needs to be instantiated at least once.
Definition: Core.hpp:51
requires std::constructible_from< TSink, TArgs... > ScopedSinkDisabling< Record_t, TSink > makeDisabledSink(TArgs &&... args)
Creates Sink disabled and registers it at this Core instance.
Definition: Core.hpp:149
Compares equality with constant at invocation.
Definition: Predicates.hpp:25
Class for logging into files.
Definition: FileSink.hpp:81
Manipulates the channel of the current RecordBuilder object.
Definition: RecordBuilder.hpp:70
std::ostream & operator<<(std::ostream &out, const ConsoleTextStyle &style)
Operator << overload for ConsoleTextStyle type.
Definition: ConsoleSink.hpp:135
ConsoleSink< Record_t > ConsoleSink_t
Type alias for log::ConsoleSink which uses preset::Record_t as Record type.
Definition: PresetTypes.hpp:80
SevLvl
A simple severity level enum type.
Definition: PresetTypes.hpp:26
Core< Record_t > Core_t
Type alias for log::Core which uses preset::Record_t as Record type.
Definition: PresetTypes.hpp:56
BaseLogger< Record_t > Logger_t
Type alias for log::Logger which uses preset::Record_t as Record type.
Definition: PresetTypes.hpp:60
BaseRecord< SevLvl, std::string > Record_t
Prepared Record type.
Definition: PresetTypes.hpp:52
FileSink< Record_t > FileSink_t
Type alias for log::FileSink which uses preset::Record_t as Record type.
Definition: PresetTypes.hpp:76
auto gLog
Definition: ReadyToGo.hpp:20
Core_t gCore
Definition: ReadyToGo.hpp:18
auto & gConsoleSink
Definition: ReadyToGo.hpp:19
Definition: BasicSink.hpp:22