Browse Source

[trac744] Avoid lexical cast if possible

Michal 'vorner' Vaner 14 years ago
parent
commit
68c9545bb7
1 changed files with 5 additions and 1 deletions
  1. 5 1
      src/lib/log/log_formatter.h

+ 5 - 1
src/lib/log/log_formatter.h

@@ -133,7 +133,11 @@ public:
     ///
     /// \param arg The argument to place into the placeholder.
     template<class Arg> Formatter arg(const Arg& value) {
-        return (arg(boost::lexical_cast<std::string>(value)));
+        if (active_) {
+            return (arg(boost::lexical_cast<std::string>(value)));
+        } else {
+            return (Formatter<Logger>());
+        }
     }
     /// \brief String version of arg.
     Formatter arg(const std::string& arg) {