OnixS BME SENAF Handler C++ library  2.0.1
API documentation
LogSettings.h
Go to the documentation of this file.
1 /*
2  * Copyright Onix Solutions Limited [OnixS]. All rights reserved.
3  *
4  * This software owned by Onix Solutions Limited [OnixS] and is protected by copyright law
5  * and international copyright treaties.
6  *
7  * Access to and use of the software is governed by the terms of the applicable ONIXS Software
8  * Services Agreement (the Agreement) and Customer end user license agreements granting
9  * a non-assignable, non-transferable and non-exclusive license to use the software
10  * for it's own data processing purposes under the terms defined in the Agreement.
11  *
12  * Except as otherwise granted within the terms of the Agreement, copying or reproduction of any part
13  * of this source code or associated reference material to any other location for further reproduction
14  * or redistribution, and any amendments to this copyright notice, are expressly prohibited.
15  *
16  * Any reproduction or redistribution for sale or hiring of the Software not in accordance with
17  * the terms of the Agreement is a violation of copyright law.
18  */
19 
20 #pragma once
21 
22 #include <OnixS/Senaf/MarketData/Export.h>
23 
24 #include <string>
25 
26 namespace OnixS { namespace Senaf { namespace MarketData {
27 
28 /// Log level.
29 struct ONIXS_BME_SENAF_EXPORT LogLevels
30 {
31  enum Enum
32  {
33  Fatal, ///< Fatal error, cannot continue.
34  Error, ///< System error, but we can go on.
35  Warning, ///< User or logic error, just say about it.
36  Info, ///< Information messages.
37  Trace, ///< Used for tracing.
38  Debug, ///< Used for debugging.
39  };
40 
41  /// Deserializes constant from string representation.
42  static Enum deserialize(const char*);
43 
44  /// Returns string representation of a state.
45  static const char* toString(Enum state);
46 };
47 
48 /// Log level alias.
50 
51 /// Additional options to control log information.
52 struct ONIXS_BME_SENAF_EXPORT AdvancedLogOptions
53 {
54  /// \copydoc AdvancedLogOptions
55  enum Enum
56  {
57  /// Nothing except standard information must be logged.
58  LogNothing = 0x00,
59 
60  /// Trace to the log file.
61  TraceToFile = 0x01,
62 
63  /// Trace to the console.
64  ///
65  /// \note Messages with LogLevel::Trace and LogLevel::Debug are not duplicated to console.
66  TraceToConsole = 0x02,
67 
68  /// Enable asynchronous logging.
69  ///
70  /// \note Instead of direct output to file or console, Handler put log message into
71  /// interthread queue, that will be processed by auxilary thread.
72  Async = 0x04,
73 
74  /// Use local time instead of UTC
75  LocalTime = 0x40,
76 
77  /// Default log settings.
78  Default = TraceToFile
79  };
80 
81  /// Returns string representation of a state.
82  static std::string toString(Enum state);
83 };
84 
85 /// Additional options to control log information.
86 typedef unsigned AdvancedLogOptionSet;
87 
88 }}} // namespace MarketData, Senaf, OnixS
Enum
Additional options to control log information.
Definition: LogSettings.h:55
Additional options to control log information.
Definition: LogSettings.h:52
System error, but we can go on.
Definition: LogSettings.h:34
LogLevels::Enum LogLevel
Log level alias.
Definition: LogSettings.h:49
Fatal error, cannot continue.
Definition: LogSettings.h:33
User or logic error, just say about it.
Definition: LogSettings.h:35
unsigned AdvancedLogOptionSet
Additional options to control log information.
Definition: LogSettings.h:86