OnixS C++ MTS Repo SDP Handler  1.3.2.8
API documentation
LogSettings.h
Go to the documentation of this file.
1 #pragma once
2 /*
3 * Copyright Onix Solutions Limited [OnixS]. All rights reserved.
4 *
5 * This software owned by ONIX SOLUTIONS LIMITED [ONIXS] and is protected by copyright law
6 * and international copyright treaties.
7 *
8 * Access to and use of the software is governed by the terms of the applicable ONIXS Software
9 * Services Agreement (the Agreement) and Customer end user license agreements granting
10 * a non-assignable, non-transferable and non-exclusive license to use the software
11 * for it's own data processing purposes under the terms defined in the Agreement.
12 *
13 * Except as otherwise granted within the terms of the Agreement, copying or reproduction of any part
14 * of this source code or associated reference material to any other location for further reproduction
15 * or redistribution, and any amendments to this copyright notice, are expressly prohibited.
16 *
17 * Any reproduction or redistribution for sale or hiring of the Software not in accordance with
18 * the terms of the Agreement is a violation of copyright law.
19 */
20 
21 #include <string>
22 
23 #include <OnixS/MTS/Repo/SDP/ABI.h>
24 
25 namespace OnixS {
26 namespace Mts {
27 namespace Repo {
28 namespace SDP {
29 
30 /// Log level.
31 ///
33 {
34  enum Enum
35  {
36  Fatal, ///< Fatal error, cannot continue.
37  Error, ///< System error, but we can go on.
38  Warning, ///< User or logic error, just say about it.
39  Info, ///< Information message.
40  Trace, ///< Used for tracing, usually including functions' names and args.
41  Debug, ///< Used for debugging.
42  };
43 };
44 
45 /// Returns string representation.
46 ///
48 
49 /// Logging options.
50 ///
52 {
53  enum Enum
54  {
55  /// Disable all tracing.
56  ///
57  NoTrace = 0x00,
58 
59  /// Trace to the log file.
60  ///
61  TraceToFile = 0x01,
62 
63  /// Trace to the console.
64  ///
65  /// @note Messages with LogLevel::Trace and LogLevel::Debug are not duplicated to console.
66  TraceToConsole = 0x02,
67 
68  /// Enable asynchronous logging.
69  ///
70  /// @note Instead of direct output to file or console, handler put log message into
71  /// interthread queue, that will be processed by auxilary thread.
72  Async = 0x04,
73 
74  /// Default log settings.
75  ///
76  Default = TraceToFile | TraceToConsole
77  };
78 };
79 
80 /// Typed logical operator helper.
81 ///
83 {
84  return LogSettings::Enum ( (int) a | (int) b);
85 }
86 
87 /// Returns string representation.
88 ///
90 
91 /// Returns string representation.
92 ///
94 
95 }
96 }
97 }
98 }
99 
100 
101 
102 
std::string bitsToString(LogSettings::Enum)
std::string enumToString(ErrorCode::Enum)
LogSettings::Enum operator|(LogSettings::Enum a, LogSettings::Enum b)
Definition: LogSettings.h:82
Used for tracing, usually including functions&#39; names and args.
Definition: LogSettings.h:40
System error, but we can go on.
Definition: LogSettings.h:37
#define ONIXS_MTS_REPO_SDP_API
Definition: ABI.h:49
User or logic error, just say about it.
Definition: LogSettings.h:38
Fatal error, cannot continue.
Definition: LogSettings.h:36