FileLogOutput.h
Go to the documentation of this file.
1 // this is for emacs file handling -*- mode: c++; indent-tabs-mode: nil -*-
2 
3 // -- BEGIN LICENSE BLOCK ----------------------------------------------
4 // This file is part of FZIs ic_workspace.
5 //
6 // This program is free software licensed under the LGPL
7 // (GNU LESSER GENERAL PUBLIC LICENSE Version 3).
8 // You can find a copy of this license in LICENSE folder in the top
9 // directory of the source code.
10 //
11 // © Copyright 2016 FZI Forschungszentrum Informatik, Karlsruhe, Germany
12 //
13 // -- END LICENSE BLOCK ------------------------------------------------
14 
15 //----------------------------------------------------------------------
26 //----------------------------------------------------------------------
27 #ifndef ICL_CORE_LOGGING_FILE_LOG_OUTPUT_H_INCLUDED
28 #define ICL_CORE_LOGGING_FILE_LOG_OUTPUT_H_INCLUDED
29 
30 #include <fstream>
31 
32 #include "icl_core/TimeSpan.h"
33 #include "icl_core/TimeStamp.h"
36 
37 #ifdef _IC_BUILDER_ZLIB_
38 # include <zlib.h>
39 #endif
40 
41 namespace icl_core {
42 namespace logging {
43 
50  protected virtual icl_core::Noncopyable
51 {
52  friend class LoggingManager;
53 
54 public:
57  static LogOutputStream *create(const icl_core::String& name, const icl_core::String& config_prefix,
59 
60 private:
61  FileLogOutput(const icl_core::String& name, const icl_core::String& config_prefix,
62  icl_core::logging::LogLevel log_level);
63  FileLogOutput(const icl_core::String& name, const icl_core::String& config_prefix,
64  icl_core::logging::LogLevel log_level, bool flush);
65  virtual ~FileLogOutput();
66 
67  virtual void pushImpl(const icl_core::String& log_line);
68 
69  void expandFilename();
70 
71  bool isOpen();
72  void flush();
73 
74  void closeLogFile();
75  void openLogFile();
76  void rotateLogFile();
77 
79  std::ofstream m_log_file;
80 
81  bool m_rotate;
83 
86 
87  bool m_flush;
88 
89 #if defined(_IC_BUILDER_ZLIB_)
90  bool m_online_zip;
91  gzFile m_zipped_log_file;
92 #endif
93 };
94 
95 }
96 }
97 
98 #endif
unsigned int uint32_t
Definition: msvc_stdint.h:93
const LogLevel cDEFAULT_LOG_LEVEL
The log level which is used initially.
Definition: LogLevel.h:60
Contains import/export definitions for the Win32 plattform.
ThreadStream & flush(ThreadStream &stream)
Definition: ThreadStream.h:241
signed __int64 int64_t
Definition: msvc_stdint.h:102
Manages the logging framework.
This is an output stream class for log messages.
std::string String
Definition: BaseTypes.h:43
Contains TimeStamp.
#define ICL_CORE_LOGGING_IMPORT_EXPORT
Contains icl_logging::LogOutputStream.


fzi_icl_core
Author(s):
autogenerated on Mon Jun 10 2019 13:17:58