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