Apache Log4cxx
Version 1.3.0
|
This class represents the location of a logging statement. More...
#include <locationinfo.h>
Public Member Functions | |
LocationInfo (const char *const fileName, const char *const shortFileName, const char *const functionName, int lineNumber) | |
Constructor. | |
LocationInfo () | |
Default constructor. | |
LocationInfo (const LocationInfo &src) | |
Copy constructor. | |
LocationInfo & | operator= (const LocationInfo &src) |
Assignment operator. | |
void | clear () |
Resets location info to default state. | |
const std::string | getClassName () const |
Return the class name of the call site. | |
const char * | getFileName () const |
Return the file name of the caller. | |
const char * | getShortFileName () const |
Return the short file name of the caller. | |
int | getLineNumber () const |
Returns the line number of the caller. | |
const std::string | getMethodName () const |
Returns the method name of the caller. | |
Static Public Member Functions | |
static const LocationInfo & | getLocationUnavailable () |
static const char * | calcShortFileName (const char *fileName) |
The part of fileName after the path. | |
Static Public Attributes | |
static const char *const | NA |
When location information is not available the constant NA is returned. | |
static const char *const | NA_METHOD |
This class represents the location of a logging statement.
log4cxx::spi::LocationInfo::LocationInfo | ( | const char *const | fileName, |
const char *const | shortFileName, | ||
const char *const | functionName, | ||
int | lineNumber ) |
Constructor.
log4cxx::spi::LocationInfo::LocationInfo | ( | ) |
Default constructor.
log4cxx::spi::LocationInfo::LocationInfo | ( | const LocationInfo & | src | ) |
Copy constructor.
src | source location |
|
inlinestatic |
The part of fileName
after the path.
Implemented to allow compile-time evaluation when called with a literal string
void log4cxx::spi::LocationInfo::clear | ( | ) |
Resets location info to default state.
const std::string log4cxx::spi::LocationInfo::getClassName | ( | ) | const |
Return the class name of the call site.
Return the file name of the caller.
int log4cxx::spi::LocationInfo::getLineNumber | ( | ) | const |
Returns the line number of the caller.
|
static |
const std::string log4cxx::spi::LocationInfo::getMethodName | ( | ) | const |
Returns the method name of the caller.
Return the short file name of the caller.
LocationInfo & log4cxx::spi::LocationInfo::operator= | ( | const LocationInfo & | src | ) |
Assignment operator.
src | source location |
When location information is not available the constant NA
is returned.
Current value of this string constant is ?.