File: DefaultFilter.h

package info (click to toggle)
spring 88.0%2Bdfsg1-1.1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 41,524 kB
  • sloc: cpp: 343,114; ansic: 38,414; python: 12,257; java: 12,203; awk: 5,748; sh: 1,204; xml: 997; perl: 405; objc: 192; makefile: 181; php: 134; sed: 2
file content (99 lines) | stat: -rwxr-xr-x 2,797 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
/* This file is part of the Spring engine (GPL v2 or later), see LICENSE.html */

#ifndef LOG_DEFAULT_FILTER_H
#define LOG_DEFAULT_FILTER_H

/**
 * A simple filter implementation for the ILog.h logging API.
 * It routes passing logging messages to the backend, and allows to set and get,
 * what is logged and what not.
 */

#ifdef __cplusplus
extern "C" {
#endif

/**
 * @name logging_filter_defaultFilter_control
 * @{
 */

/**
 * Sets the minimum level to log for all sections, including the default one.
 *
 * The compile-time min-level (_LOG_LEVEL_MIN) takes precedence of this one.
 * This one takes precedence over the section specific one
 * (log_filter_section_setMinLevel).
 * You may set a more restrictive min-level then a preceding instance, but
 * setting a less restrictive one has no effect.
 *
 * @see #log_filter_global_getMinLevel
 * @see #log_filter_section_setMinLevel
 */
void log_filter_global_setMinLevel(int level);

/**
 * Returns the minimum level to log.
 * @see #log_filter_global_setMinLevel
 * @see #log_filter_section_getMinLevel
 */
int log_filter_global_getMinLevel();

/**
 * Sets whether log messages for a certain section are logged or not.
 *
 * The compile-time min-level (_LOG_LEVEL_MIN) takes precedence of this one.
 * The global run-time min-level (log_filter_global_setMinLevel) takes
 * precedence over this one.
 * You may set a more restrictive min-level then a preceding instance, but
 * setting a less restrictive one has no effect.
 *
 * On release builds, the initial default section (LOG_SECTION_DEFAULT)
 * min-level is L_INFO, and L_WARNING for non-default sections.
 * On debug builds, all sections initial min-level is set to L_DEBUG.
 *
 * CAUTION: you may only use strings defined at compile-time.
 * @see #log_filter_section_getMinLevel
 */
void log_filter_section_setMinLevel(const char* section, int level);

/**
 * Returns the minimum level to log for a certain section.
 * All sections are enabled by default.
 *
 * CAUTION: you may only use strings defined at compile-time.
 * @see #log_filter_section_setMinLevel
 */
int log_filter_section_getMinLevel(const char* section);

/**
 * Returns the number of currently registered sections.
 * @see #log_filter_section_getRegisteredIndex
 */
int log_filter_section_getRegistered();

/**
 * Returns a registered section.
 * @see #log_filter_section_getRegistered
 */
const char* log_filter_section_getRegisteredIndex(int index);

#ifdef __cplusplus
} // extern "C"
#endif

#ifdef __cplusplus
#include <set>

/**
 * Returns the registered sections.
 * This is simply to be more C++ friendly.
 * @see #log_filter_section_getRegistered
 */
std::set<const char*> log_filter_section_getRegisteredSet();
#endif

/** @} */ // logging_filter_defaultFilter_control

#endif // LOG_DEFAULT_FILTER_H