made it easier to define custom loggers per file
This commit is contained in:
parent
bb3c3ec118
commit
0c0a53541a
1 changed files with 12 additions and 8 deletions
|
|
@ -57,6 +57,10 @@ namespace fc
|
||||||
|
|
||||||
} // namespace fc
|
} // namespace fc
|
||||||
|
|
||||||
|
#ifndef DEFAULT_LOOGER
|
||||||
|
#define DEFAULT_LOOGER
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#define fc_dlog( LOGGER, FORMAT, ... ) \
|
#define fc_dlog( LOGGER, FORMAT, ... ) \
|
||||||
do { \
|
do { \
|
||||||
|
|
@ -88,29 +92,29 @@ namespace fc
|
||||||
|
|
||||||
#define dlog( FORMAT, ... ) \
|
#define dlog( FORMAT, ... ) \
|
||||||
do { \
|
do { \
|
||||||
if( (fc::logger::get()).is_enabled( fc::log_level::debug ) ) { \
|
if( (fc::logger::get(DEFAULT_LOOGER)).is_enabled( fc::log_level::debug ) ) { \
|
||||||
(fc::logger::get()).log( FC_LOG_MESSAGE( debug, FORMAT, __VA_ARGS__ ) ); \
|
(fc::logger::get(DEFAULT_LOOGER)).log( FC_LOG_MESSAGE( debug, FORMAT, __VA_ARGS__ ) ); \
|
||||||
} \
|
} \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
#define ilog( FORMAT, ... ) \
|
#define ilog( FORMAT, ... ) \
|
||||||
do { \
|
do { \
|
||||||
if( (fc::logger::get()).is_enabled( fc::log_level::info ) ) { \
|
if( (fc::logger::get(DEFAULT_LOOGER)).is_enabled( fc::log_level::info ) ) { \
|
||||||
(fc::logger::get()).log( FC_LOG_MESSAGE( info, FORMAT, __VA_ARGS__ ) ); \
|
(fc::logger::get(DEFAULT_LOOGER)).log( FC_LOG_MESSAGE( info, FORMAT, __VA_ARGS__ ) ); \
|
||||||
} \
|
} \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
#define wlog( FORMAT, ... ) \
|
#define wlog( FORMAT, ... ) \
|
||||||
do { \
|
do { \
|
||||||
if( (fc::logger::get()).is_enabled( fc::log_level::warn ) ) { \
|
if( (fc::logger::get(DEFAULT_LOOGER)).is_enabled( fc::log_level::warn ) ) { \
|
||||||
(fc::logger::get()).log( FC_LOG_MESSAGE( warn, FORMAT, __VA_ARGS__ ) ); \
|
(fc::logger::get(DEFAULT_LOOGER)).log( FC_LOG_MESSAGE( warn, FORMAT, __VA_ARGS__ ) ); \
|
||||||
} \
|
} \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
#define elog( FORMAT, ... ) \
|
#define elog( FORMAT, ... ) \
|
||||||
do { \
|
do { \
|
||||||
if( (fc::logger::get()).is_enabled( fc::log_level::error ) ) { \
|
if( (fc::logger::get(DEFAULT_LOOGER)).is_enabled( fc::log_level::error ) ) { \
|
||||||
(fc::logger::get()).log( FC_LOG_MESSAGE( error, FORMAT, __VA_ARGS__ ) ); \
|
(fc::logger::get(DEFAULT_LOOGER)).log( FC_LOG_MESSAGE( error, FORMAT, __VA_ARGS__ ) ); \
|
||||||
} \
|
} \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue