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