From 1a43fad56dc945c72a4ab711d2c9ff6d1a5a1502 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Wed, 30 Sep 2009 22:28:33 +0200 Subject: Added Format class for improved logging experience :) --- src/modules/UserConfigBackendKrb5/UserConfigBackendKrb5.cpp | 6 +++--- src/modules/UserConfigBackendKrb5/UserConfigBackendKrb5.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src/modules/UserConfigBackendKrb5') diff --git a/src/modules/UserConfigBackendKrb5/UserConfigBackendKrb5.cpp b/src/modules/UserConfigBackendKrb5/UserConfigBackendKrb5.cpp index 61ad996..72c8160 100644 --- a/src/modules/UserConfigBackendKrb5/UserConfigBackendKrb5.cpp +++ b/src/modules/UserConfigBackendKrb5/UserConfigBackendKrb5.cpp @@ -68,7 +68,7 @@ void UserConfigBackendKrb5::_connect() { const_cast(KADM5_ADMIN_SERVICE), ¶ms, KADM5_STRUCT_VERSION, KADM5_API_VERSION_2, 0, &handle); if(err) { - application->logf(Core::Logger::LOG_USER, Core::Logger::LOG_ERROR, "kadm5_init_with_password: %s", krb5_get_error_message(context, err)); + application->log(Core::Logger::LOG_USER, Core::Logger::LOG_ERROR, Core::Format("kadm5_init_with_password: %1%") % krb5_get_error_message(context, err)); return; } } @@ -84,7 +84,7 @@ void UserConfigBackendKrb5::_connect() { const_cast(KADM5_ADMIN_SERVICE), ¶ms, KADM5_STRUCT_VERSION, KADM5_API_VERSION_2, 0, &handle); if(err) { - application->logf(Core::Logger::LOG_USER, Core::Logger::LOG_ERROR, "kadm5_init_with_skey: %s", krb5_get_error_message(context, err)); + application->log(Core::Logger::LOG_USER, Core::Logger::LOG_ERROR, Core::Format("kadm5_init_with_skey: %1%") % krb5_get_error_message(context, err)); return; } } @@ -226,7 +226,7 @@ void UserConfigBackendKrb5::deleteUser(const Common::UserInfo &userInfo) throw(C krb5_free_principal(context, princ); if(err) - application->logf(Core::Logger::LOG_USER, Core::Logger::LOG_WARNING, "kadm5_delete_principal: %s", krb5_get_error_message(context, err)); + application->log(Core::Logger::LOG_USER, Core::Logger::LOG_WARNING, Core::Format("kadm5_delete_principal: %1%") % krb5_get_error_message(context, err)); } void UserConfigBackendKrb5::setPassword(const Common::UserInfo &userInfo, const Core::String &password) throw(Core::Exception) { diff --git a/src/modules/UserConfigBackendKrb5/UserConfigBackendKrb5.h b/src/modules/UserConfigBackendKrb5/UserConfigBackendKrb5.h index 64f8501..c02f868 100644 --- a/src/modules/UserConfigBackendKrb5/UserConfigBackendKrb5.h +++ b/src/modules/UserConfigBackendKrb5/UserConfigBackendKrb5.h @@ -64,7 +64,7 @@ class UserConfigBackendKrb5 : public Common::UserConfigBackend, private Core::Co UserConfigBackendKrb5(Common::Application *application0) : application(application0), handle(0) { krb5_error_code err = krb5_init_context(&context); if(err) { - application->logf("Unable to initialize kerberos context: %s", std::strerror(err)); + application->log(Core::Format("Unable to initialize kerberos context: %1%") % std::strerror(err)); context = 0; return; } -- cgit v1.2.3