Skip to content

Commit

Permalink
Merge pull request log4cplus#337 from wilx/2.0.x
Browse files Browse the repository at this point in the history
Merge.
  • Loading branch information
wilx authored Aug 20, 2018
2 parents 903c82e + 9ebe994 commit 82de91e
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ autom4te.cache/
objdir*/
Win32/
x64/
build/
.vscode/

docs/log4cplus-*/
docs/webpage_docs-*/

.idea

Expand Down
5 changes: 5 additions & 0 deletions .mailmap
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Václav Haisman <[email protected]>
Václav Haisman <[email protected]>
Václav Haisman <[email protected]>
Václav Haisman <[email protected]>
Václav Haisman <[email protected]>
6 changes: 6 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@

- Add `configure` script option `--enable-lto` to allow easier LTO builds.

- Optimization of `getFormattedTime()`. (Alexey Vishtak)

- Introduction of `LOG4CPLUS_MACRO_FILE()` used in logging macros to allow
users to redefine it and consequently hide source file names from their
compiled executables and logging output.


# log4cplus 2.0.1

Expand Down
19 changes: 15 additions & 4 deletions include/log4cplus/loggingmacros.h
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,13 @@ LOG4CPLUS_EXPORT void macro_forced_log (log4cplus::Logger const &,
# endif
#endif

#undef LOG4CPLUS_MACRO_FILE
#define LOG4CPLUS_MACRO_FILE() nullptr
#if ! defined (LOG4CPLUS_DISABLE_FILE_MACRO)
# undef LOG4CPLUS_MACRO_FILE
# define LOG4CPLUS_MACRO_FILE() __FILE__
#endif


// Make TRACE and DEBUG log level unlikely and INFO, WARN, ERROR and
// FATAL log level likely.
Expand Down Expand Up @@ -212,7 +219,8 @@ LOG4CPLUS_EXPORT void macro_forced_log (log4cplus::Logger const &,
_log4cplus_buf << logEvent; \
log4cplus::detail::macro_forced_log (_l, \
log4cplus::logLevel, _log4cplus_buf.str(), \
__FILE__, __LINE__, LOG4CPLUS_MACRO_FUNCTION ()); \
LOG4CPLUS_MACRO_FILE (), __LINE__, \
LOG4CPLUS_MACRO_FUNCTION ()); \
} \
} while (0) \
LOG4CPLUS_RESTORE_DOWHILE_WARNING()
Expand All @@ -227,7 +235,8 @@ LOG4CPLUS_EXPORT void macro_forced_log (log4cplus::Logger const &,
_l.isEnabledFor (log4cplus::logLevel), logLevel)) { \
log4cplus::detail::macro_forced_log (_l, \
log4cplus::logLevel, logEvent, \
__FILE__, __LINE__, LOG4CPLUS_MACRO_FUNCTION ()); \
LOG4CPLUS_MACRO_FILE (), __LINE__, \
LOG4CPLUS_MACRO_FUNCTION ()); \
} \
} while(0) \
LOG4CPLUS_RESTORE_DOWHILE_WARNING()
Expand All @@ -244,7 +253,8 @@ LOG4CPLUS_EXPORT void macro_forced_log (log4cplus::Logger const &,
= _snpbuf.print (__VA_ARGS__); \
log4cplus::detail::macro_forced_log (_l, \
log4cplus::logLevel, _logEvent, \
__FILE__, __LINE__, LOG4CPLUS_MACRO_FUNCTION ()); \
LOG4CPLUS_MACRO_FILE (), __LINE__, \
LOG4CPLUS_MACRO_FUNCTION ()); \
} \
} while(0) \
LOG4CPLUS_RESTORE_DOWHILE_WARNING()
Expand All @@ -258,7 +268,8 @@ LOG4CPLUS_EXPORT void macro_forced_log (log4cplus::Logger const &,
#if !defined(LOG4CPLUS_DISABLE_TRACE)
#define LOG4CPLUS_TRACE_METHOD(logger, logEvent) \
log4cplus::TraceLogger _log4cplus_trace_logger(logger, logEvent, \
__FILE__, __LINE__, LOG4CPLUS_MACRO_FUNCTION ());
LOG4CPLUS_MACRO_FILE (), __LINE__, \
LOG4CPLUS_MACRO_FUNCTION ());
#define LOG4CPLUS_TRACE(logger, logEvent) \
LOG4CPLUS_MACRO_BODY (logger, logEvent, TRACE_LOG_LEVEL)
#define LOG4CPLUS_TRACE_STR(logger, logEvent) \
Expand Down

0 comments on commit 82de91e

Please sign in to comment.