From daf2ea8209dbaf171436278843c9b8c83cf88006 Mon Sep 17 00:00:00 2001 From: Bjoern Sikora Date: Thu, 30 Jul 2009 16:27:39 +0200 Subject: [PATCH] Tuned Logger. --- src/logger.cpp | 66 ++++++++++++++++++++++++++++++++++++++----------------- src/logger.h | 2 - 2 files changed, 45 insertions(+), 23 deletions(-) diff --git a/src/logger.cpp b/src/logger.cpp index 9515aba..d9ad2b8 100644 --- a/src/logger.cpp +++ b/src/logger.cpp @@ -62,6 +62,7 @@ void Logger::print_cmd_parsed() /** * Prints out the successful parsing of the config files. + * @param config_path The specified config path. */ void Logger::print_conf_loaded(const string& config_path) { @@ -70,30 +71,22 @@ void Logger::print_conf_loaded(const string& config_path) /** - * Prints out the successful parsing of the config files. + * Prints out the unsuccessful parsing of the config files. + * @param config_path The specified config path. */ void Logger::print_conf_not_loaded(const string& config_path) { - cout << "Config files couldn't be loaded in: " << config_path << endl; -} - - -/** - * Prints out the detection of unknown option on config file. - */ -void Logger::print_unknown_conf_option() -{ - cout << "Unknown option in config file detected" << endl; - cout << "See manpage for config file structure." << endl; + cerr << "Config files couldn't be loaded in: " << config_path << endl; } /** - * Prints out error on opening file + * A file could not be opened for reading. + * @param filename The filename. */ void Logger::print_error_opening(const string& filename) { - cout << "Error opening file for reading: " << filename << endl; + cerr << "Error opening file for reading: " << filename << endl; } @@ -119,7 +112,7 @@ void Logger::print_constructor_call(const string& _class) /** * Update method for specified service was called. - * @param service The service which for which is running the update. + * @param service The service for which is the update running. */ void Logger::print_update_service(const string& service) { @@ -127,49 +120,80 @@ void Logger::print_update_service(const string& service) } +/** + * An unknown option on the command line was detected. + * @param unknown_option The unknown option. + */ void Logger::print_unknown_cmd_option(const string& unknown_option) { - cout << "Unknown option on command line detected: " << unknown_option << endl; + cerr << "Unknown option on command line detected: " << unknown_option << endl; } +/** + * An unknown protocol was specified. + * @param protocol The unknown protocol. + */ void Logger::print_unknown_protocol(const string& protocol) { - cout << "Unknown protocol defined: " << protocol << endl; + cerr << "Unknown protocol defined: " << protocol << endl; } +/** + * Loading a service config file. + * @param filename The service config file. + */ void Logger::print_load_service_conf(const string& filename) { cout << "Loading service config file: " << filename << endl; } +/** + * Loading the main config file. + * @param filename The main config file. + */ void Logger::print_load_main_conf(const string& filename) { cout << "Loading main config file: " << filename << endl; } +/** + * There is an unknown option in a service config file. + * @param unknown_option The unknown option. + */ void Logger::print_unknown_service_conf_option(const string& unknown_option) { - cout << "Unknown option in service config file detected: " << unknown_option << endl; + cerr << "Unknown option in service config file detected: " << unknown_option << endl; } +/** + * There is an unknown option in the main config file. + * @param unknown_option The unknown option. + */ void Logger::print_unknown_main_conf_option(const string& unknown_option) { - cout << "Unknown option in mian config file detected: " << unknown_option << endl; + cerr << "Unknown option in main config file detected: " << unknown_option << endl; } +/** + * The defined config path doesn't exist or is not a directory. + * @param config_path The defined config path. + */ void Logger::print_error_config_path(const string& config_path) { - cout << "Config path doesn't exists or is not a diretory: " << config_path << endl; + cerr << "Config path doesn't exists or is not a diretory: " << config_path << endl; } +/** + * There is a missing command line option to initialize a service object. + */ void Logger::print_missing_cmd_service_option() { - cout << "Missing option to initialize service. Protocol, host, login and password must be specified." << endl; + cerr << "Missing option to initialize service. Protocol, host, login and password must be specified." << endl; } diff --git a/src/logger.h b/src/logger.h index d17a6b2..cb99f84 100644 --- a/src/logger.h +++ b/src/logger.h @@ -29,8 +29,6 @@ public: void print_cmd_parsed(); - void print_unknown_conf_option(); - void print_destructor_call(const string&); void print_constructor_call(const string&); -- 1.7.1