Fire Core  8.0.0.alpha
GIS framework per tutti gli usi
 Tutto Classi Namespace Funzioni Variabili Ridefinizioni di tipo (typedef) Tipi enumerati (enum) Valori del tipo enumerato Friend
SimpleLogger.hpp
1 // Copyright 2015 GEOSYSTEMS SRL
2 // All Rights Reserved.
3 
4 #ifndef FIRE_LOGGING_SIMPLE_SIMPLELOGGER_HPP_INCLUDED
5 #define FIRE_LOGGING_SIMPLE_SIMPLELOGGER_HPP_INCLUDED
6 
7 #include <boost/smart_ptr/shared_ptr.hpp>
8 #include <boost/log/sinks/sync_frontend.hpp>
9 #include <boost/log/sinks/text_ostream_backend.hpp>
10 
11 #include <exception>
12 #include <ostream>
13 #include <string>
14 #include <set>
15 
16 #include "fire/export.hpp"
17 
18 #include "fire/logging/spi/AbstractLogger.hpp"
19 #include "fire/logging/Level.hpp"
20 
25 namespace fire {
30 namespace logging {
35 namespace simple {
40 class FIRE_ENGINE_DLL SimpleLogger : public virtual fire::logging::spi::AbstractLogger {
41  private:
46  typedef boost::log::sinks::synchronous_sink< boost::log::sinks::text_ostream_backend > Sink;
47 
48  private:
58  boost::shared_ptr< std::ostream > outputStream;
63  boost::shared_ptr< fire::logging::simple::SimpleLogger::Sink > sink;
77  static bool filter(boost::log::value_ref< std::string, tag::tagsAttribute > const& tagsAttributeValue, std::set< std::string >* tags);
78 
79  public:
93  SimpleLogger(const std::string& name, fire::logging::Level::Level defaultLevel, std::ostream* outputStream);
98  virtual ~SimpleLogger();
106  fire::logging::Level::Level getLevel();
114  void setLevel(fire::logging::Level::Level level);
125  bool isEnabled(fire::logging::Level::Level level);
136  void logMessage(fire::logging::Level::Level level, const std::string& message);
144  void setStream(std::ostream* outputStream);
145 };
146 } // namespace simple
147 } // namespace logging
148 } // namespace fire
149 
150 #endif
Classe per la gestione di un logger semplice.
Definition: SimpleLogger.hpp:40
Classe astratta per la gestione di un logger.
Definition: AbstractLogger.hpp:41
Level
Enumerativo per la gestione di un livello di log.
Definition: Level.hpp:26