ealogger
ealogger is a c++ library that provides a blazing fast and easy to use logging mechanism
sink_console.h
Go to the documentation of this file.
1 // ealogger is a simple, asynchronous and powerful logger library for c++
2 // Copyright 2013 - 2016 Christian Rapp
3 //
4 // Licensed under the Apache License, Version 2.0 (the "License");
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
7 //
8 // http://www.apache.org/licenses/LICENSE-2.0
9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 
16 #ifndef SINK_CONSOLE_H
17 #define SINK_CONSOLE_H
18 
21 #include <iostream>
22 
23 #include <ealogger/sink.h>
24 
25 namespace ealogger
26 {
34 class SinkConsole : public Sink
35 {
36 public:
45  SinkConsole(std::string msg_template, std::string datetime_pattern,
47  virtual ~SinkConsole();
48 
49 private:
50  std::mutex mtx_console;
51 
52  void write_message(const std::string &msg);
53  void config_changed();
54 };
56 }
57 
58 #endif /* SINK_CONSOLE_H */
std::string datetime_pattern
Definition: sink.h:141
Sink to write to a console.
Definition: sink_console.h:34
SinkConsole(std::string msg_template, std::string datetime_pattern, bool enabled, ealogger::constants::LOG_LEVEL min_lvl)
Console sink constructor.
Definition: sink_console.cpp:21
Main namespace for ealogger.
Definition: conversion_pattern.h:28
A sink is an object that writes the log message to a specific target.
Definition: sink.h:52
bool enabled
Definition: sink.h:142
std::string msg_template
Definition: sink.h:140
LOG_LEVEL
An enumaration representing the supported loglevels.
Definition: global.h:58