|
| LogOrigin () |
| The default constructor sets a null class name, function name, object id, source file name, and sets the line number to zero. More...
|
|
| LogOrigin (const String &globalFunctionName, const SourceLocation *where=0) |
| Use this constructor if the log message origination is from a global function. More...
|
|
| LogOrigin (const String &className, const String &memberFuncName, const SourceLocation *where=0) |
| Use this constructor if the log message origination is from a class member function. More...
|
|
| LogOrigin (const String &className, const String &memberFuncName, const ObjectID &id, const SourceLocation *where=0) |
| Use this constructor if the log message origination is from a distributed object (don't worry if you don't know what this means). More...
|
|
| LogOrigin (const LogOrigin &other) |
| Make this LogOrigin a copy of other . More...
|
|
LogOrigin & | operator= (const LogOrigin &other) |
|
| ~LogOrigin () |
|
const String & | taskName () const |
| Get or set the corresponding element of the source location. More...
|
|
LogOrigin & | taskName (const String &funcName) |
|
const String & | functionName () const |
|
LogOrigin & | functionName (const String &funcName) |
|
const String & | className () const |
|
LogOrigin & | className (const String &className) |
|
const ObjectID & | objectID () const |
|
LogOrigin & | objectID (const ObjectID &id) |
|
uInt | line () const |
|
LogOrigin & | line (uInt which) |
|
const String & | fileName () const |
|
LogOrigin & | fileName (const String &fileName) |
|
LogOrigin & | sourceLocation (const SourceLocation *where) |
| Set the file name and line number at the same time. More...
|
|
String | fullName () const |
| Returns class::function for a member function, or ::function for a global function. More...
|
|
String | toString () const |
| Turn the entire origin into a String. More...
|
|
String | location () const |
| Turns the entire origin except for the ObjectID into a String. More...
|
|
Bool | isUnset () const |
| Return true if the line number and file name are not set. More...
|
|
LogOrigin: The source code location of the originator of a LogMessage.
Intended use:
Public interface
Review Status
- Reviewed By:
- wbrouw
- Date Reviewed:
- 1996/08/21
- Test programs:
- tLogging
- Demo programs:
- dLogging
Prerequisite
-
ObjectID if you are interested in logging from Distributed Objects (don't worry if you don't know what that means - in that case ignore it!).
Etymology
Log[message] Origin[ation point].
Synopsis
The LogOriging
class is used to record the location at which a LogMessage originates. It consists of:
-
A class name, which is blank in the case of a global function.
-
A function name - global or member. You should "cut and paste" not only the function name, but also the arguments (but not the return type) to ensure that the function name is unique in the face of overloading.
-
A source file name, usually filled in with the
WHERE
predefined macro.
-
A line number, usually filled in with the
LINE
or WHERE
macros.
-
An ObjectID if the log message comes from a distributed object (if you don't know what this means, you don't need to worry about it).
-
Eventually we may want to canonicalize the path in the filename.
Example
See the examples for LogMessage and in (see (file="Logging.h"))Logging.h.
Motivation
It can be very useful for debugging if you know where a message is coming from.
To Do
Definition at line 94 of file LogOrigin.h.