* @param name the name used as ident.
* @param facility the facility which should be used.
*/
-void enable_syslog( const std::string& name, Facility facility )
+void enable_syslog( const std::string& name, const Facility &facility )
{
boost::recursive_mutex::scoped_lock lock(LoggerLock);
* determined by reading the program path from /proc/\<pid\>/exe.
* @param facility the facility which should be used.
*/
-void enable_syslog( Facility facility )
+void enable_syslog_facility( const Facility &facility )
{
boost::recursive_mutex::scoped_lock lock(LoggerLock);
* enable or disable logging to syslog.
* @param enable whether the logging to syslog should be enabled or not.
*/
-void enable_syslog( bool enable )
+void enable_syslog( const bool enable )
{
boost::recursive_mutex::scoped_lock lock(LoggerLock);
{
if (!g_syslog_opened)
{
- enable_syslog( g_facility );
+ enable_syslog_facility( g_facility );
}
}
else // ! enable
** They work globally; i.e. they determine the loggin for the whole program!
*/
-void enable_syslog( const std::string& name, Facility facility= Facility::User );
-void enable_syslog( Facility facility );
-void enable_syslog( bool enable= true );
+void enable_syslog( const std::string& name, const Facility &facility= Facility::User );
+void enable_syslog_facility( const Facility &facility ); // avoid compiler casting facility to bool
+void enable_syslog( const bool enable= true );
void enable_stderr_log(bool enable= true );
BOOST_AUTO_TEST_CASE(Syslog1)
{
//Logger::enable_syslog("I2N Unittest", Logger::Facility::User );
- Logger::enable_syslog( Logger::Facility::User );
+ Logger::enable_syslog_facility( Logger::Facility::User );
Logger::PartLogger log(__func__);
Logger::set_log_level( 7 );
BOOST_AUTO_TEST_CASE(TestScopeTrace1)
{
//Logger::enable_syslog("I2N Unittest", Logger::Facility::User );
- Logger::enable_syslog( Logger::Facility::User );
+ Logger::enable_syslog_facility( Logger::Facility::User );
Logger::PartLogger log(__func__);
Logger::set_log_level( 7 );
BOOST_AUTO_TEST_CASE(TestRecursiveScopeTracker)
{
- Logger::enable_syslog( Logger::Facility::User );
+ Logger::enable_syslog_facility( Logger::Facility::User );
Logger::PartLogger log(__func__);
Logger::set_log_level( 7 );