#include <iostream>
#include <sstream>

class Log 
{
public:
  ~Log() {
    std::cout << "[WARING] " << out.str() << std::endl;
  }

  std::ostringstream out;
  std::ostream& get() { return out; }
};

#define log_warning if(1); else Log().get()

int main()
{
  log_warning << "Warning";

  return 0;
}

