Legrand / Raritan / Server Technology Xerus™ PDU JSON-RPC API
DiagLogSettings.idl
1 /* SPDX-License-Identifier: BSD-3-Clause */
2 /*
3  * Copyright 2010 Raritan Inc. All rights reserved.
4  */
5 
6 #ifndef __DIAGLOGSETTINGS_IDL__
7 #define __DIAGLOGSETTINGS_IDL__
8 
9 /**
10  * Diagnostics
11  */
12 module diag {
13 
14  /** Diagnostic log settings */
15  interface DiagLogSettings {
16 
17  /** Log levels */
18  enumeration LogLevel {
19  LOG_LEVEL_NONE, ///< no log messages
20  LOG_LEVEL_ERR, ///< errors
21  LOG_LEVEL_WARN, ///< warnings + errors
22  LOG_LEVEL_INFO, ///< info + warnings + errors
23  LOG_LEVEL_DEBUG, ///< debug + info + warnings + errors
24  LOG_LEVEL_TRACE ///< trace + debug + info + warnings + errors
25  };
26 
27  /** An entry containing a context name and its associated context. */
28  structure LogLevelEntry {
29  string ctxName; ///< log context name
30  LogLevel logLevel; ///< log level
31  };
32 
33  constant int ERR_NONE = 0; ///< no error
34  constant int ERR_UNKNOWN_LOG_CONTEXT_NAME = 1; ///< unknown log context
35  constant int ERR_UNKNOWN_LOG_LEVEL = 2; ///< unknown log level
36 
37  /**
38  * Reset log levels of all contexts to default.
39  */
41 
42  /**
43  * Get log levels of all contexts.
44  *
45  * @return vector of LogLevelEntry structures
46  */
47  vector<LogLevelEntry> getLogLevelsForAllCtxNames();
48 
49  /**
50  * Set the log level for all contexts at once.
51  *
52  * @param logLevel - log level
53  *
54  * @return ERR_NONE on success
55  * @return ERR_UNKNOWN_LOG_LEVEL if log level is unknown
56  */
58 
59  /**
60  * Get the log level for a specific context.
61  *
62  * @param ctxName - context name
63  * @param logLevel - result: log level
64  *
65  * @return ERR_NONE on success
66  * @return ERR_UNKNOWN_LOG_CONTEXT_NAME if the context is unknown
67  * @return ERR_UNKNOWN_LOG_LEVEL if log level cannot be mapped to JSON
68  */
69  int getLogLevelByCtxName(in string ctxName, out LogLevel logLevel);
70 
71  /**
72  * Set the log level for a specific context.
73  *
74  * @param ctxName - context name
75  * @param logLevel - log level
76  *
77  * @return ERR_NONE on success
78  * @return ERR_UNKNOWN_LOG_CONTEXT_NAME if the context is unknown
79  * @return ERR_UNKNOWN_LOG_LEVEL if log level is unknown
80  */
81  int setLogLevelByCtxName(in string ctxName, in LogLevel logLevel);
82  };
83 
84 }
85 
86 #endif /* __DIAGLOGSETTINGS_IDL__ */
Diagnostic log settings.
Definition: DiagLogSettings.idl:15
vector< LogLevelEntry > getLogLevelsForAllCtxNames()
Get log levels of all contexts.
int getLogLevelByCtxName(in string ctxName, out LogLevel logLevel)
Get the log level for a specific context.
LogLevel
Log levels.
Definition: DiagLogSettings.idl:18
@ LOG_LEVEL_DEBUG
debug + info + warnings + errors
Definition: DiagLogSettings.idl:23
@ LOG_LEVEL_INFO
info + warnings + errors
Definition: DiagLogSettings.idl:22
@ LOG_LEVEL_ERR
errors
Definition: DiagLogSettings.idl:20
@ LOG_LEVEL_WARN
warnings + errors
Definition: DiagLogSettings.idl:21
@ LOG_LEVEL_NONE
no log messages
Definition: DiagLogSettings.idl:19
int setLogLevelByCtxName(in string ctxName, in LogLevel logLevel)
Set the log level for a specific context.
int setLogLevelForAllCtxNames(in LogLevel logLevel)
Set the log level for all contexts at once.
void resetLogLevelsForAllCtxNames()
Reset log levels of all contexts to default.
Diagnostics.
Definition: DiagLogSettings.idl:12
An entry containing a context name and its associated context.
Definition: DiagLogSettings.idl:28
string ctxName
log context name
Definition: DiagLogSettings.idl:29
LogLevel logLevel
log level
Definition: DiagLogSettings.idl:30