libtrbase
1.0.2
Web server and task management solution.
Main Page
Related Pages
Data Structures
Files
File List
Globals
logger.h
Go to the documentation of this file.
1
/**
2
* \file
3
* A generic logger class and two extended classes, One that logs to
4
* stderr and one that logs to the system syslog.
5
*
6
* \author Georg Hopp
7
*
8
* \copyright
9
* Copyright © 2014 Georg Hopp
10
*
11
* This program is free software: you can redistribute it and/or modify
12
* it under the terms of the GNU General Public License as published by
13
* the Free Software Foundation, either version 3 of the License, or
14
* (at your option) any later version.
15
*
16
* This program is distributed in the hope that it will be useful,
17
* but WITHOUT ANY WARRANTY; without even the implied warranty of
18
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19
* GNU General Public License for more details.
20
*
21
* You should have received a copy of the GNU General Public License
22
* along with this program. If not, see <http://www.gnu.org/licenses/>.
23
*/
24
25
#ifndef __TR_LOGGER_H__
26
#define __TR_LOGGER_H__
27
28
#include "
trbase.h
"
29
30
typedef
enum
{
31
TR_LOGGER_DEBUG
=0,
32
TR_LOGGER_INFO
,
33
TR_LOGGER_NOTICE
,
34
TR_LOGGER_WARNING
,
35
TR_LOGGER_ERR
,
36
TR_LOGGER_CRIT
,
37
TR_LOGGER_ALERT
,
38
TR_LOGGER_EMERG
39
}
TR_logger_level
;
40
41
#include "
tr/interface/logger.h
"
42
43
extern
const
char
*
const
TR_logger_level_str
[];
44
45
TR_CLASS
(TR_Logger) {
46
TR_logger_level
min_level;
47
};
48
49
TR_CLASS
(TR_LoggerStderr) {
50
TR_EXTENDS
(TR_Logger);
51
};
52
53
TR_CLASS
(TR_LoggerSyslog) {
54
TR_EXTENDS
(TR_Logger);
55
};
56
57
TR_INSTANCE_INIT
(TR_Logger);
58
TR_INSTANCE_INIT
(TR_LoggerStderr);
59
TR_INSTANCE_INIT
(TR_LoggerSyslog);
60
61
TR_CLASSVARS_DECL
(TR_Logger) {};
62
TR_CLASSVARS_DECL
(TR_LoggerStderr) {};
63
TR_CLASSVARS_DECL
(TR_LoggerSyslog) {};
64
65
extern
TR_Logger
TR_logger
;
66
67
#endif // __TR_LOGGER_H__
68
69
// vim: set ts=4 sw=4:
TR_logger_level
TR_logger_level
Definition:
logger.h:30
TR_CLASS
TR_CLASS(TR_Logger)
Definition:
logger.h:45
TR_logger_level_str
const char *const TR_logger_level_str[]
Definition:
logger.c:31
TR_LOGGER_WARNING
Definition:
logger.h:34
TR_LOGGER_INFO
Definition:
logger.h:32
logger.h
TR_EXTENDS
#define TR_EXTENDS(parent)
Definition:
class.h:96
TR_LOGGER_NOTICE
Definition:
logger.h:33
TR_logger
TR_Logger TR_logger
Definition:
stderr.c:41
TR_LOGGER_EMERG
Definition:
logger.h:38
TR_LOGGER_CRIT
Definition:
logger.h:36
TR_CLASSVARS_DECL
TR_CLASSVARS_DECL(TR_Logger)
Definition:
logger.h:61
trbase.h
TR_LOGGER_ERR
Definition:
logger.h:35
TR_LOGGER_ALERT
Definition:
logger.h:37
TR_INSTANCE_INIT
TR_INSTANCE_INIT(TR_Logger)
TR_LOGGER_DEBUG
Definition:
logger.h:31
include
tr
logger.h
Generated on Fri Mar 25 2016 22:18:50 for libtrbase by
1.8.10