Allow user programme to set RMR verbosity level
[ric-plt/lib/rmr.git] / src / rmr / common / include / rmr_logging.h
1 // :vi sw=4 ts=4 noet:
2 /*
3 ==================================================================================
4         Copyright (c) 2019-2020 Nokia
5         Copyright (c) 2018-2020 AT&T Intellectual Property.
6
7    Licensed under the Apache License, Version 2.0 (the "License");
8    you may not use this file except in compliance with the License.
9    You may obtain a copy of the License at
10
11            http://www.apache.org/licenses/LICENSE-2.0
12
13    Unless required by applicable law or agreed to in writing, software
14    distributed under the License is distributed on an "AS IS" BASIS,
15    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16    See the License for the specific language governing permissions and
17    limitations under the License.
18 ==================================================================================
19 */
20 /*
21         Mnemonic:       rmr_logging.h
22         Abstract:       All needed header stuff for RMR's common logger.
23                 
24         Author:         E. Scott Daniels
25         Date:           27 January 2020
26 */
27
28 #ifndef _logger_h
29 #define _logger_h
30
31
32 // situation constants
33 #define LOG_ERROR       "ERR"
34 #define LOG_WARN        "WARN"
35 #define LOG_INFO        "INFO"
36 #define LOG_CRIT        "CRIT"
37 #define LOG_DEBUG       "DBUG"
38
39 /*
40         vlevel constants; ordered such that if( vlevel >= write_level  ) is true when we have a 
41         verbose level setting condusive for writing. 
42 */
43 #define RMR_VL_DEBUG    5
44 #define RMR_VL_INFO             4
45 #define RMR_VL_WARN             3
46 #define RMR_VL_ERR              2
47 #define RMR_VL_CRIT             1
48 #define RMR_VL_OFF              0
49
50
51 // ----- prototypes ------------------------------
52 extern void rmr_vlog( int write_level, char* fmt, ... );
53 extern void rmr_vlog_force( int write_level, char* fmt, ... );
54 extern int rmr_vlog_init();
55 extern void rmr_set_vlevel( int new_level );
56
57
58
59 #endif
60