OnixS C++ SGX Titan OUCH Trading Handler  1.2.0
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 
24 
25 #include <string>
26 
28 
29 /// Log level.
30 ///
31 struct ONIXS_SGXTITAN_OUCH_API LogLevel
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 message.
39  Trace, ///< Used for tracing, usually including functions' names and args.
40  Debug, ///< Used for debugging.
41  };
42 };
43 
44 /// Returns string representation.
45 ///
46 ONIXS_SGXTITAN_OUCH_API std::string enumToString (LogLevel::Enum);
47 
48 /// Logging options.
49 ///
50 struct ONIXS_SGXTITAN_OUCH_API LogSettings
51 {
52  enum Enum
53  {
54  /// Disable all tracing.
55  ///
56  NoTrace = 0x00,
57 
58  /// Trace to the log file.
59  TraceToFile = 0x01,
60 
61  /// Trace to the console.
62  /// @note Messages with LogLevel::Trace and LogLevel::Debug are not duplicated to console.
63  TraceToConsole = 0x02,
64 
65  /// Enable asynchronous logging.
66  ///
67  /// @note Instead of direct output to file or console, handler put log message into
68  /// interthread queue, that will be processed by auxilary thread.
69  Async = 0x04,
70 
71  /// Default log settings.
72  ///
73  Default = TraceToFile | TraceToConsole
74  };
75 };
76 
77 /// Typed logical operator helper.
78 ///
80 {
81  return LogSettings::Enum ( (int) a | (int) b);
82 }
83 
84 /// Returns string representation.
85 ///
86 ONIXS_SGXTITAN_OUCH_API std::string enumToString (LogSettings::Enum);
87 
88 /// Returns string representation.
89 ///
90 ONIXS_SGXTITAN_OUCH_API std::string bitsToString (LogSettings::Enum);
91 
93 
94 
95 
96 
System error, but we can go on.
Definition: LogSettings.h:36
ONIXS_SGXTITAN_OUCH_API std::string enumToString(LogSettings::Enum)
Used for tracing, usually including functions&#39; names and args.
Definition: LogSettings.h:39
Fatal error, cannot continue.
Definition: LogSettings.h:35
#define ONIXS_SGXTITAN_OUCH_NAMESPACE_END
Definition: Bootstrap.h:31
#define ONIXS_SGXTITAN_OUCH_NAMESPACE_BEGIN
Definition: Bootstrap.h:27
ONIXS_SGXTITAN_OUCH_API std::string bitsToString(LogSettings::Enum)
LogSettings::Enum operator|(LogSettings::Enum a, LogSettings::Enum b)
Definition: LogSettings.h:79
User or logic error, just say about it.
Definition: LogSettings.h:37