mirror of
https://github.com/gabime/spdlog.git
synced 2025-01-13 09:20:25 +08:00
Merge pull request #2476 from nigels-com/SPDLOG_NO_SOURCE_LOC
SPDLOG_NO_SOURCE_LOC support for omitting __FILE__, __LINE__ etc
This commit is contained in:
commit
b60512731b
@ -292,7 +292,11 @@ inline void critical(const T &msg)
|
|||||||
// SPDLOG_LEVEL_OFF
|
// SPDLOG_LEVEL_OFF
|
||||||
//
|
//
|
||||||
|
|
||||||
|
#ifndef SPDLOG_NO_SOURCE_LOC
|
||||||
#define SPDLOG_LOGGER_CALL(logger, level, ...) (logger)->log(spdlog::source_loc{__FILE__, __LINE__, SPDLOG_FUNCTION}, level, __VA_ARGS__)
|
#define SPDLOG_LOGGER_CALL(logger, level, ...) (logger)->log(spdlog::source_loc{__FILE__, __LINE__, SPDLOG_FUNCTION}, level, __VA_ARGS__)
|
||||||
|
#else
|
||||||
|
#define SPDLOG_LOGGER_CALL(logger, level, ...) (logger)->log(spdlog::source_loc{}, level, __VA_ARGS__)
|
||||||
|
#endif
|
||||||
|
|
||||||
#if SPDLOG_ACTIVE_LEVEL <= SPDLOG_LEVEL_TRACE
|
#if SPDLOG_ACTIVE_LEVEL <= SPDLOG_LEVEL_TRACE
|
||||||
# define SPDLOG_LOGGER_TRACE(logger, ...) SPDLOG_LOGGER_CALL(logger, spdlog::level::trace, __VA_ARGS__)
|
# define SPDLOG_LOGGER_TRACE(logger, ...) SPDLOG_LOGGER_CALL(logger, spdlog::level::trace, __VA_ARGS__)
|
||||||
|
@ -19,6 +19,13 @@
|
|||||||
// #define SPDLOG_CLOCK_COARSE
|
// #define SPDLOG_CLOCK_COARSE
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Uncomment if source location logging is not needed.
|
||||||
|
// This will prevent spdlog from using __FILE__, __LINE__ and SPDLOG_FUNCTION
|
||||||
|
//
|
||||||
|
// #define SPDLOG_NO_SOURCE_LOC
|
||||||
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
// Uncomment if thread id logging is not needed (i.e. no %t in the log pattern).
|
// Uncomment if thread id logging is not needed (i.e. no %t in the log pattern).
|
||||||
// This will prevent spdlog from querying the thread id on each log call.
|
// This will prevent spdlog from querying the thread id on each log call.
|
||||||
|
Loading…
Reference in New Issue
Block a user