Legrand / Raritan / Server Technology Xerus™ JSON-RPC API

Loading...
Searching...
No Matches
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 */
12module 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 */
40 void resetLogLevelsForAllCtxNames();
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 */
57 int setLogLevelForAllCtxNames(in LogLevel logLevel);
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__ */
diag::DiagLogSettings
Diagnostic log settings.
Definition DiagLogSettings.idl:15
diag::DiagLogSettings::getLogLevelsForAllCtxNames
vector< LogLevelEntry > getLogLevelsForAllCtxNames()
Get log levels of all contexts.
diag::DiagLogSettings::getLogLevelByCtxName
int getLogLevelByCtxName(in string ctxName, out LogLevel logLevel)
Get the log level for a specific context.
diag::DiagLogSettings::LogLevel
LogLevel
Log levels.
Definition DiagLogSettings.idl:18
diag::DiagLogSettings::LOG_LEVEL_DEBUG
@ LOG_LEVEL_DEBUG
debug + info + warnings + errors
Definition DiagLogSettings.idl:23
diag::DiagLogSettings::LOG_LEVEL_INFO
@ LOG_LEVEL_INFO
info + warnings + errors
Definition DiagLogSettings.idl:22
diag::DiagLogSettings::LOG_LEVEL_ERR
@ LOG_LEVEL_ERR
errors
Definition DiagLogSettings.idl:20
diag::DiagLogSettings::LOG_LEVEL_WARN
@ LOG_LEVEL_WARN
warnings + errors
Definition DiagLogSettings.idl:21
diag::DiagLogSettings::LOG_LEVEL_TRACE
@ LOG_LEVEL_TRACE
trace + debug + info + warnings + errors
Definition DiagLogSettings.idl:24
diag::DiagLogSettings::LOG_LEVEL_NONE
@ LOG_LEVEL_NONE
no log messages
Definition DiagLogSettings.idl:19
diag::DiagLogSettings::ERR_UNKNOWN_LOG_LEVEL
constant int ERR_UNKNOWN_LOG_LEVEL
unknown log level
Definition DiagLogSettings.idl:35
diag::DiagLogSettings::ERR_UNKNOWN_LOG_CONTEXT_NAME
constant int ERR_UNKNOWN_LOG_CONTEXT_NAME
unknown log context
Definition DiagLogSettings.idl:34
diag::DiagLogSettings::ERR_NONE
constant int ERR_NONE
no error
Definition DiagLogSettings.idl:33
diag::DiagLogSettings::setLogLevelByCtxName
int setLogLevelByCtxName(in string ctxName, in LogLevel logLevel)
Set the log level for a specific context.
diag::DiagLogSettings::setLogLevelForAllCtxNames
int setLogLevelForAllCtxNames(in LogLevel logLevel)
Set the log level for all contexts at once.
diag::DiagLogSettings::resetLogLevelsForAllCtxNames
void resetLogLevelsForAllCtxNames()
Reset log levels of all contexts to default.
diag
Diagnostics.
Definition DiagLogSettings.idl:12
diag::DiagLogSettings::LogLevelEntry
An entry containing a context name and its associated context.
Definition DiagLogSettings.idl:28
diag::DiagLogSettings::LogLevelEntry::ctxName
string ctxName
log context name
Definition DiagLogSettings.idl:29
diag::DiagLogSettings::LogLevelEntry::logLevel
LogLevel logLevel
log level
Definition DiagLogSettings.idl:30