Browse Source

Clean up some duplicate checks

Sam Jaffe 6 years ago
parent
commit
db992ed55d
2 changed files with 3 additions and 10 deletions
  1. 3 6
      include/logger/logger.h
  2. 0 4
      src/logger.cxx

+ 3 - 6
include/logger/logger.h

@@ -40,15 +40,13 @@ namespace logging {
 
     template <typename... Args>
     inline void log(level ll, std::string const & interp, Args && ...args) {
-      log( ll, location_info{}, interp, std::forward<Args>(args)... );
+      log(ll, location_info{}, interp, std::forward<Args>(args)...);
     }
     
     template <typename... Args>
     inline void log(level ll, location_info info,
                     std::string const & interp, Args && ...args) {
-      if ( should_log( ll ) ) {
-        log( ll, info, message( interp, std::forward<Args>(args)... ) );
-      }
+      log(ll, info, message(interp, std::forward<Args>(args)...));
     }
     
     void flush();
@@ -58,8 +56,7 @@ namespace logging {
     
   private:
     friend class manager;
-    bool should_log( level ) const;
-    void log( level ll, location_info info, message const& );
+    void log(level ll, location_info info, message const&);
 
   private:
     std::string const logger_name_;

+ 0 - 4
src/logger.cxx

@@ -34,10 +34,6 @@ namespace logging {
     impl_->write({ now(), ll, info, logger_name_, msg });
   }
   
-  bool logger::should_log(level ll) const {
-    return impl_->should_log( ll );
-  }
-  
   void logger::flush() {
     impl_->flush();
   }