Date: Tuesday, January 24, 2006 @ 18:55:33
  Author: marc
    Path: /cvsroot/carob/carob/src

Modified: Common.cpp (1.20 -> 1.21)

created carobLog(prefix,...) to share code among all log functions


------------+
 Common.cpp |   19 +++++++++++++------
 1 files changed, 13 insertions(+), 6 deletions(-)


Index: carob/src/Common.cpp
diff -u carob/src/Common.cpp:1.20 carob/src/Common.cpp:1.21
--- carob/src/Common.cpp:1.20   Wed Jan 18 13:04:38 2006
+++ carob/src/Common.cpp        Tue Jan 24 18:55:33 2006
@@ -34,7 +34,7 @@
 using std::endl;
 
 
-// On linux try "locale -a" to get the list of all available locales.
+// On linux or MACOSX>10.4 try "locale -a" to get the list of all available 
locales.
 // TODO: it would be nice to be able to get this at runtime
 // (in a non-portable way quite obviously...)
 
@@ -47,6 +47,13 @@
 
 #define NAME_OF_ANY_UTF8_LOCALE_AVAILABLE "en_US.utf8"
 
+namespace {
+  inline void
+  carobLog(const wstring& prefix, const wstring& fctName, const wstring& msg)
+  {
+    wcerr << prefix << L'(' << fctName << L") " << msg << endl;
+  }
+}
 
 void CarobNS::setLogLevel(const LogLevel l)
 {
@@ -55,27 +62,27 @@
 
 void CarobNS::logVerbose(const wstring fctName, const wstring s)
 {
-  wcerr<<VERBOSE_PRE<<L'('<<fctName<<L") "<<s<<endl;
+  carobLog(VERBOSE_PRE, fctName, s);
 }
 
 void CarobNS::logInfo(const wstring fctName, const wstring s)
 {
-  wcerr<<INFO_PRE<<L'('<<fctName<<L") "<<s<<endl;
+  carobLog(INFO_PRE, fctName, s);
 }
 
 void CarobNS::logDebug(const wstring fctName, const wstring s)
 {
-  wcerr<<DEBUG_PRE<<L'('<<fctName<<L") "<<s<<endl;
+  carobLog(DEBUG_PRE, fctName, s);
 }
 
 void CarobNS::logWarning(const wstring fctName, const wstring s)
 {
-  wcerr<<WARNING_PRE<<L'('<<fctName<<L") "<<s<<endl;
+  carobLog(WARNING_PRE, fctName, s);
 }
 
 void CarobNS::logError(const wstring fctName, const wstring s)
 {
-  wcerr<<ERROR_PRE<<L'('<<fctName<<L") "<<s<<endl;
+  carobLog(ERROR_PRE, fctName, s);
 }
 
 bool CarobNS::isVerboseEnabled()

_______________________________________________
Carob-commits mailing list
[email protected]
https://forge.continuent.org/mailman/listinfo/carob-commits

Reply via email to