Fix LOG(LogLevel) for MSVC compiler

This commit is contained in:
David Capello 2016-10-31 19:43:18 -03:00
parent 2366721a82
commit a911915aab
2 changed files with 6 additions and 5 deletions

View File

@ -89,10 +89,10 @@ std::ostream& base::get_log_stream(LogLevel level)
return log_stream;
}
void LOG(const char* format, ...)
std::ostream& LOG(const char* format, ...)
{
if (log_level < INFO)
return;
return null_stream;
char buf[2048];
va_list ap;
@ -106,4 +106,5 @@ void LOG(const char* format, ...)
#endif
va_end(ap);
return log_stream;
}

View File

@ -21,9 +21,6 @@ enum LogLevel {
VERBOSE = 5, // Information step by step
};
// E.g. LOG("text in information log level\n");
void LOG(const char* format, ...);
#ifdef __cplusplus
#include <iosfwd>
@ -36,6 +33,9 @@ namespace base {
} // namespace base
// E.g. LOG("text in information log level\n");
std::ostream& LOG(const char* format, ...);
// E.g. LOG(INFO) << "some information\n";
inline std::ostream& LOG(LogLevel level) {
return base::get_log_stream(level);