From b8e6af28fe1fe1a57ad7df2a7622c6bc71d314b1 Mon Sep 17 00:00:00 2001 From: ps Date: Thu, 6 Jan 2011 22:55:59 +0000 Subject: [PATCH] print a small log message with the config file name --- ChangeLog | 10 ++++++++-- src/Configfile.cpp.in | 3 +++ src/Utils.cpp | 11 +++++++++++ src/Utils.h | 1 + 4 files changed, 23 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index b00834a..dfb53b8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,9 +1,15 @@ ChangeLog --------- -2008-12-14 20:17 Juan José Gutiérrez de Quevedo +2011-01-06 23:53 Juan José Gutiérrez de Quevedo -* 1.7 release +* development restarted + +* print a small message about which config file we are actually using. Some +people seem to have gotten confused about this... + + +2008-12-14 20:17 Juan José Gutiérrez de Quevedo * Implemented log rotation for filelogger. Sponsored by Damir Simunic of http://edgeof.net diff --git a/src/Configfile.cpp.in b/src/Configfile.cpp.in index 0c549f2..e29a0e6 100644 --- a/src/Configfile.cpp.in +++ b/src/Configfile.cpp.in @@ -19,6 +19,8 @@ */ #include "Configfile.h" +extern LOGGER_CLASS hermes_log; + /** * default config * @@ -34,6 +36,7 @@ void Configfile::parse(string file) char line[255]; int equalpos; + hermes_log.addMessage(LOG_INFO,"parsing "+Utils::get_canonical_filename(file)+" configuration file"); f.open(file.c_str(),ios::in); while(!f.eof()) { diff --git a/src/Utils.cpp b/src/Utils.cpp index 19bf83e..74cc889 100644 --- a/src/Utils.cpp +++ b/src/Utils.cpp @@ -346,6 +346,17 @@ bool Utils::file_exists(string file) } } +string Utils::get_canonical_filename(string file) +{ + char *buffer=NULL; + string result; + + buffer=realpath(file.c_str(),NULL); + result=buffer; + free(buffer); + + return result; +} /** * whether a directory is accesible by current process/user * diff --git a/src/Utils.h b/src/Utils.h index f3ff02c..2e3e55a 100644 --- a/src/Utils.h +++ b/src/Utils.h @@ -74,6 +74,7 @@ class Utils #endif //WIN32 //misc + static string get_canonical_filename(string); static bool file_exists(string); static bool dir_exists(string); static string errnotostrerror(int);