18 #ifndef _LOG4CXX_SPI_LOCATION_LOCATIONINFO_H 19 #define _LOG4CXX_SPI_LOCATION_LOCATIONINFO_H 21 #include <log4cxx/log4cxx.h> 25 #if __cpp_lib_string_view || (_MSVC_LANG >= 201703L) 26 #include <string_view> 27 #define LOG4CXX_HAS_STRING_VIEW 33 #define LOG4CXX_SHORT_FILENAME_SPLIT_CHAR '\\' 35 #define LOG4CXX_SHORT_FILENAME_SPLIT_CHAR '/' 56 static const char*
const NA;
61 #ifdef LOG4CXX_HAS_STRING_VIEW 62 static constexpr
const char* calcShortFileName(
const char* fileName){
63 std::string_view view(fileName);
71 return location ==
nullptr ? fileName : location + 1;
81 const char*
const shortFileName,
82 const char*
const functionName,
109 const std::string getClassName()
const;
115 const char* getFileName()
const;
122 const char* getShortFileName()
const;
128 int getLineNumber()
const;
131 const std::string getMethodName()
const;
141 const char* fileName;
144 const char* shortFileName;
147 const char* methodName;
154 #if !defined(LOG4CXX_LOCATION) && !LOG4CXX_DISABLE_LOCATION_INFO 155 #if defined(_MSC_VER) 157 #define __LOG4CXX_FUNC__ __FUNCSIG__ 160 #if defined(__GNUC__) 161 #define __LOG4CXX_FUNC__ __PRETTY_FUNCTION__ 163 #if defined(__BORLANDC__) 164 #define __LOG4CXX_FUNC__ __FUNC__ 168 #if !defined(__LOG4CXX_FUNC__) 169 #define __LOG4CXX_FUNC__ "" 173 #define LOG4CXX_LOCATION ::log4cxx::spi::LocationInfo(__FILE__, \ 174 ::log4cxx::spi::LocationInfo::calcShortFileName(__FILE__), \ 179 #define LOG4CXX_LOCATION ::log4cxx::spi::LocationInfo::getLocationUnavailable() 180 #endif // LOG4CXX_LOCATION 182 #endif //_LOG4CXX_SPI_LOCATION_LOCATIONINFO_H static const char * calcShortFileName(const char *fileName)
Definition: locationinfo.h:69
static const char *const NA_METHOD
Definition: locationinfo.h:57
#define LOG4CXX_SHORT_FILENAME_SPLIT_CHAR
Definition: locationinfo.h:35
Emulates java serialization.
Definition: objectoutputstream.h:33
This class represents the location of a logging statement.
Definition: locationinfo.h:46
Definition: appender.h:32
static const char *const NA
When location information is not available the constant NA is returned.
Definition: locationinfo.h:56