title: Are C++ style logging macros possible in Python?
body: <p>Is it possible to implement the equivalent of the following (pseudo-)code in Python?</p>
  
  <pre><code>#define DEBUG(topic, msg) LOG_IMPL(Logger.DEBUG, topic, msg)
  #define INFO(topic, msg) LOG_IMPL(Logger.INFO, topic, msg)
  #define LOG_IMPL(level, topic, msg) if(Logger.level() &lt;= level) { Logger.log(level, topic, msg); }
  
  DEBUG("MyComponent", "What you logging at?")
  </code></pre>
  
  <p>The benefit here being you don't have to evaluate the string log messages, e.g. joining strings, calling .format(), etc.)</p>
  
  <p><strong>UPDATE</strong>:</p>
  
  <p><a href="https://stackoverflow.com/questions/4148790/lazy-logger-message-string-evaluation">Lazy logger message string evaluation</a> - this answers my question so I will vote to close this post.</p>