title: C++ define argument overloading
body: <p>I've written simple logger for unified logging in my library.
  What I have now:</p>
  
  <pre><code>enum LogLevel {
      DEBUG,
      INFO,
      WARNING,
      ERROR
  };
  
  //this calls vfprintf(...)
  void Log( LogLevel level, const char * format, ...);
  
  //compile time log string concatenation, if logs should be disabled define NO_LOGS during compilation
  #ifndef NO_LOGS
      #define LOG(LEVEL, MSG, ...) Log(LEVEL, "[" #LEVEL "] " MSG "\n", ##__VA_ARGS__)
  #else
      #define LOG(LEVEL, MSG, ...)
  #endif
  
  //defines for fast logging
  #define LOGD(MSG, ...) LOG(DEBUG, MSG, ##__VA_ARGS__)
  #define LOGI(MSG, ...) LOG(INFO, MSG, ##__VA_ARGS__)
  #define LOGW(MSG, ...) LOG(WARNING, MSG, ##__VA_ARGS__)
  #define LOGE(MSG, ...) LOG(ERROR, MSG, ##__VA_ARGS__)
  </code></pre>
  
  <p>This is awesome but I have one problem with it. While calling <code>LOGI("log value %d", value)</code> works as expects, it's not possible to call <code>LOGI("simple log msg")</code> instead I have to call <code>LOGI("%s","simple log msg")</code>which just looks awful. Is it possible to solve this problem in defines? I've tried a following code but it doesn't compile since define overloading based on arguments is not possible in C++. </p>
  
  <pre><code>#define LOGD(MSG, ...) LOG(DEBUG, MSG, ##__VA_ARGS__)
  #define LOGD(MSG) LOG(DEBUG, "%s", MSG)
  </code></pre>
  
  <p>I know I can easily solve this by using normal functions overloading, but I really want to have logging system with minimal overhead hence usage of defines that allow me to concatenate strings in compile time.</p>
  
  <p>Any ideas?</p>