Started with boost/serialization error handling.
[bpdyndnsd] / src / logger.h
CommitLineData
254bbf53
BS
1/** @file
2 * @brief Logger class header. This class represents the Logging facility.
3 *
4 *
5 *
6 * @copyright Intra2net AG
7 * @license GPLv2
8*/
9
10#ifndef LOGGER_H
11#define LOGGER_H
12
8bca3c5d 13#include <syslog.h>
59c8d63c 14#include <sstream>
254bbf53 15
7f3ced8c
BS
16typedef boost::shared_ptr<boost::program_options::options_description> Options_descriptionPtr;
17
27baf279 18
254bbf53
BS
19class Logger
20{
8bca3c5d
BS
21private:
22 int Loglevel;
23 bool Syslog;
254bbf53
BS
24
25public:
26
27 Logger();
28
29 ~Logger();
30
59c8d63c
BS
31 void log_notice(const std::string&);
32
33 void log_warning(const std::string&);
34
35 void log_error(const std::string&);
36
8bca3c5d
BS
37 void set_loglevel(const int);
38
39 int get_loglevel();
40
41 void set_syslog(const bool);
42
43 bool get_syslog();
44
45 void set_log_facility(const int, const bool);
46
7f3ced8c 47 void print_usage(const Options_descriptionPtr);
254bbf53
BS
48
49 void print_version();
50
51 void print_cmd_parsed();
52
8bca3c5d 53 void print_destructor_call(const std::string&);
254bbf53 54
8bca3c5d 55 void print_constructor_call(const std::string&);
254bbf53 56
8bca3c5d 57 void print_update_service(const std::string&);
254bbf53 58
8bca3c5d 59 void print_unknown_cmd_option(const std::string&);
254bbf53 60
8bca3c5d 61 void print_unknown_protocol(const std::string&);
254bbf53 62
8bca3c5d 63 void print_load_service_conf(const std::string&);
254bbf53 64
8bca3c5d 65 void print_load_main_conf(const std::string&);
254bbf53 66
8bca3c5d 67 void print_unknown_service_conf_option(const std::string&);
254bbf53 68
8bca3c5d 69 void print_unknown_main_conf_option(const std::string&);
254bbf53 70
8bca3c5d 71 void print_error_opening(const std::string&);
254bbf53 72
8bca3c5d 73 void print_error_config_path(const std::string&);
254bbf53 74
8bca3c5d 75 void print_conf_loaded(const std::string&);
254bbf53 76
8bca3c5d 77 void print_conf_not_loaded(const std::string&);
254bbf53
BS
78
79 void print_missing_cmd_service_option();
388f4ab0
BS
80
81 void print_runnig_as_daemon(const int);
82
83 void print_daemon_mode(const bool);
84
85 void print_error_fork();
86
87 void print_pid_found(const int);
88
89 void print_process_already_running(const int);
c5675c01
BS
90
91 void print_caught_sigterm();
92
93 void print_caught_siguser1();
94
95 void print_caught_sighup();
8bca3c5d
BS
96
97 void print_error_setting_signal();
98
99 void print_init_log_facility();
100
101 void print_offline_mode();
27baf279
BS
102
103 void print_serialized_objects_success();
104
105 void print_deserialized_objects_success();
106
107 void print_service_object(const std::string&, const std::string&, const std::string&, const std::string&, const std::string&, const std::string&, const int);
5d38cfe6
BS
108
109 void print_exception_serialize(const std::string&);
254bbf53
BS
110};
111
112#endif