OnixS C++ Tradeweb Approved Publication Arrangement (APA) Handler  1.2.2.18
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 {
28  namespace Tradeweb
29  {
30  namespace MarketData
31  {
32  namespace Apa
33  {
34 
35  /// Log level.
36  struct ONIXS_TRADEWEB_APA_API LogLevel
37  {
38  enum Enum
39  {
40  Fatal, ///< Fatal error, cannot continue.
41  Error, ///< System error, but we can go on.
42  Warning, ///< User or logic error, just say about it.
43  Info, ///< Information message.
44  Trace, ///< Used for tracing, usually including functions' names and args.
45  Debug, ///< Used for debugging.
46  };
47  };
48 
49  /// Returns string representation of ErrorCode value.
50  ONIXS_TRADEWEB_APA_API std::string enumToString (LogLevel::Enum);
51 
52  /// Logging options.
53  struct ONIXS_TRADEWEB_APA_API LogSettings
54  {
55  enum Enum
56  {
57  /// Trace to the log file.
58  TraceToFile = 0x01,
59 
60  /// Duplicate log messages to console.
61  /// @note Messages with LogLevel::Trace and LogLevel::Debug are not duplicated to console.
62  TraceToConsole = 0x02,
63 
64  /// Use asynchronous logging
65  Async = 0x4,
66 
67  /// if TraceToConsole is set, then direct output to stderr
68  ConsoleErr = 0x8,
69 
70  /// if TraceToConsole is set, then set up colored output mode
71  ConsoleColored = 0x10,
72 
73  /// if TraceToConsole is set, then append prefix to output
74  ConsoleShowPrefix = 0x20,
75 
76  /// Log binary data of received packets, applied only for Info log level and below.
77  LogPackets = 0x40,
78 
79  /// Log updated order book, applied only for Debug log level.
80  LogBooks = 0x80,
81 
82  /// Default log settings.
83  Default = TraceToFile | LogPackets | LogBooks
84  };
85  };
86 
87  /// Typed logical operator helper.
89  {
90  return LogSettings::Enum ( (int) a | (int) b);
91  }
92 
93 
94  /// Log file read permissions.
95  struct ONIXS_TRADEWEB_APA_API LogFilePermission
96  {
97  enum Enum
98  {
99  /// read access only for owner of process
100  ReadOwnerOnly = 0x01,
101 
102  /// read access for all
103  ReadAll = 0x02,
104 
105  /// write access only for owner of process
106  WriteOwnerOnly = 0x04,
107 
108  /// write access for all
109  WriteAll = 0x08,
110 
111  /// Default value
112  Default = ReadAll | WriteOwnerOnly
113  };
114  };
115 
116  /// Typed logical operator helper.
118  {
119  return static_cast<LogFilePermission::Enum> (static_cast<int> (a) | static_cast<int> (b) );
120  }
121  }
122  }
123  }
124 }
125 
126 
127 
128 
129 
130 
131 
ONIXS_TRADEWEB_APA_API std::string enumToString(ErrorCode::Enum)
Returns string representation of ErrorCode value.
Used for tracing, usually including functions&#39; names and args.
Definition: LogSettings.h:44
System error, but we can go on.
Definition: LogSettings.h:41
User or logic error, just say about it.
Definition: LogSettings.h:42
LogSettings::Enum operator|(LogSettings::Enum a, LogSettings::Enum b)
Typed logical operator helper.
Definition: LogSettings.h:88