Skip to content

Commit

Permalink
Allow for a FMT layout configuration when log4cxx is statically linked (
Browse files Browse the repository at this point in the history
  • Loading branch information
swebb2066 authored Oct 25, 2024
1 parent 0ff3c8a commit bcf2f12
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/main/cpp/class.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@
#include <log4cxx/htmllayout.h>
#include <log4cxx/simplelayout.h>
#include <log4cxx/xml/xmllayout.h>
#if LOG4CXX_HAS_FMT_LAYOUT
#include <log4cxx/fmtlayout.h>
#endif

#include <log4cxx/filter/levelmatchfilter.h>
#include <log4cxx/filter/levelrangefilter.h>
Expand Down Expand Up @@ -183,6 +186,9 @@ void Class::registerClasses()
SMTPAppender::registerClass();
JSONLayout::registerClass();
HTMLLayout::registerClass();
#if LOG4CXX_HAS_FMT_LAYOUT
FMTLayout::registerClass();
#endif
PatternLayout::registerClass();
SimpleLayout::registerClass();
XMLLayout::registerClass();
Expand Down
6 changes: 6 additions & 0 deletions src/main/include/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,12 @@ else()
set(DOMCONFIGURATOR_SUPPORT 0)
endif()

if(ENABLE_FMT_LAYOUT)
set(FMT_LAYOUT_SUPPORT 1)
else()
set(FMT_LAYOUT_SUPPORT 0)
endif()

option(LOG4CXX_MULTIPROCESS_ROLLING_FILE_APPENDER "Support multiple processes logging to the same file" OFF)
if(LOG4CXX_MULTIPROCESS_ROLLING_FILE_APPENDER)
set(MULTIPROCESS_RFA 1)
Expand Down
1 change: 1 addition & 0 deletions src/main/include/log4cxx/log4cxx.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
#define LOG4CXX_HAS_MULTIPROCESS_ROLLING_FILE_APPENDER @MULTIPROCESS_RFA@
#define LOG4CXX_EVENTS_AT_EXIT @EVENTS_AT_EXIT@
#define LOG4CXX_HAS_DOMCONFIGURATOR @DOMCONFIGURATOR_SUPPORT@
#define LOG4CXX_HAS_FMT_LAYOUT @FMT_LAYOUT_SUPPORT@


#define LOG4CXX_USE_GLOBAL_SCOPE_TEMPLATE 0
Expand Down

0 comments on commit bcf2f12

Please sign in to comment.