| 90 | |
| 91 | private: |
| 92 | static void Write(LogLevel level, const char* level_str, const char *format, va_list val) { |
| 93 | if (level <= GetLevel()) { // omit the message with low level |
| 94 | // write to STDOUT |
| 95 | printf("[LightGBM] [%s] ", level_str); |
| 96 | vprintf(format, val); |
| 97 | printf("\n"); |
| 98 | fflush(stdout); |
| 99 | } |
| 100 | } |
| 101 | |
| 102 | // a trick to use static variable in header file. |
| 103 | // May be not good, but avoid to use an additional cpp file |