OnixS C++ Eurex T7 Market and Reference Data (EMDI, MDI, RDI, EOBI) Handlers  17.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 
23 
24 #include <string>
25 
26 namespace OnixS
27 {
28  namespace Eurex
29  {
30  namespace MarketData
31  {
32 
33  /// Log level.
34  struct ONIXS_EUREX_EMDI_API LogLevel
35  {
36  enum Enum
37  {
38  Fatal, ///< Fatal error, cannot continue.
39  Error, ///< System error, but we can go on.
40  Warning, ///< User or logic error, just say about it.
41  Info, ///< Information message.
42  Trace, ///< Used for tracing, usually including functions' names and args.
43  Debug, ///< Used for debugging.
44  };
45  };
46 
47  /// Returns string representation of ErrorCode value.
48  ONIXS_EUREX_EMDI_API std::string enumToString (LogLevel::Enum);
49 
50  /// Logging options.
51  struct ONIXS_EUREX_EMDI_API LogSettings
52  {
53  enum Enum
54  {
55  /// Trace to the log file.
56  TraceToFile = 0x01,
57 
58  /// Duplicate log messages to console.
59  /// @note Messages with LogLevel::Trace and LogLevel::Debug are not duplicated to console.
60  TraceToConsole = 0x02,
61 
62  /// Use asynchronous logging
63  Async = 0x04,
64 
65  /// if TraceToConsole is set, then direct output to stderr
66  ConsoleErr = 0x8,
67 
68  /// if TraceToConsole is set, then set up colored output mode
69  ConsoleColored = 0x10,
70 
71  /// if TraceToConsole is set, then append prefix to output
72  ConsoleShowPrefix = 0x20,
73 
74  /// Log binary data of received packets, applied only for Info log level and below.
75  LogPackets = 0x40,
76 
77  /// Log updated order book, applied only for Debug log level.
78  LogBooks = 0x80,
79 
80  /// Default log settings.
81  Default = TraceToFile | LogPackets | LogBooks
82  };
83  };
84 
85  /// Typed logical operator helper.
87  {
88  return LogSettings::Enum ( (int) a | (int) b);
89  }
90  }
91  }
92 }
Definition: Defines.h:30
LogSettings::Enum operator|(LogSettings::Enum a, LogSettings::Enum b)
Typed logical operator helper.
Definition: LogSettings.h:86
Used for tracing, usually including functions&#39; names and args.
Definition: LogSettings.h:42
Fatal error, cannot continue.
Definition: LogSettings.h:38
System error, but we can go on.
Definition: LogSettings.h:39
User or logic error, just say about it.
Definition: LogSettings.h:40
std::string enumToString(HandlerState::Enum)
Returns string representation of HandlerState value.