Used to customize the formatting of the logging output that is generated by the Logger class. Each Logger instance holds its own LogFormatOptions instance that can be set through Logger::setLogFormatOptions().
- See also
- Logger::getFormatOptions(), Logger::setFormatOptions()
◆ LogFormatOptions()
◆ ~LogFormatOptions()
◆ operator==()
operator==.
- Returns
- true, if both operands are equal, false otherwise. Two instances are treated as equal, if all their public getters return equal values for them.
◆ operator!=()
operator!=.
- Returns
- false, if operator==() would return true, true otherwise.
◆ getAddDateTime()
bool getAddDateTime |
( |
void |
| ) |
const |
- Returns
- 'true', if log lines are prefixed with the date and time of the EGLOG() call, 'false' otherwise.
- See also
- setAddDateTime()
◆ setAddDateTime()
Sets the value of the AddDateTime flag. The default value of this flag is 'true'.
- Parameters
-
addTime | 'true' instructs the Logger instance to prefix log lines with the date and time of the EGLOG() call, 'false' prevents it from doing so. |
- See also
- getAddDateTime()
◆ getAddLevel()
bool getAddLevel |
( |
void |
| ) |
const |
◆ setAddLevel()
Sets the value of the AddLevel flag. The default value of this flag is 'true'.
- Parameters
-
addLevel | 'true' instructs the Logger instance to prefix log lines with the DebugLevel of the EGLOG() call, 'false' prevents it from doing so. |
- See also
- getAddLevel()
◆ getAddFile()
bool getAddFile |
( |
void |
| ) |
const |
- Returns
- 'true', if log lines are prefixed with the source file of the EGLOG() call, 'false' otherwise.
- See also
- setAddFile()
◆ setAddFile()
Sets the value of the AddFile flag. The default value of this flag is 'true'.
- Parameters
-
addFile | 'true' instructs the Logger instance to prefix log lines with the source file of the EGLOG() call, 'false' prevents it from doing so. |
- See also
- getAddFile()
◆ getAddFunction()
bool getAddFunction |
( |
void |
| ) |
const |
- Returns
- 'true', if log lines are prefixed with the name of the function that did the EGLOG() call, 'false' otherwise.
- See also
- setAddFunction()
◆ setAddFunction()
Sets the value of the AddFunction flag. The default value of this flag is 'true'.
- Parameters
-
addFunction | 'true' instructs the Logger instance to prefix log lines with the name of the function that did the EGLOG() call, 'false' prevents it from doing so. |
- See also
- getAddFunction()
◆ getMaxNumberOfNamespaces()
unsigned int getMaxNumberOfNamespaces |
( |
void |
| ) |
const |
◆ setMaxNumberOfNamespaces()
LogFormatOptions & setMaxNumberOfNamespaces |
( |
unsigned int |
maxNumberOfNamespaces | ) |
|
Sets the maximum number of namespaces that are included in the name of the function that did the EGLOG() call. The default value of this option is UINT_MAX, which means that all namespaces should be printed.
- Note
- The name of the class counts as a namespace in this context and inner namespaces take precedence about outer namespaces.
Example:
The fully qualified name of the class member function includes 3 namespaces and the class name and is CompanyName::ProductName::ProjectName::ClassName::functionName().
- If the maxNumberOfNamespaces is 0, then the printed function name will be functionName().
- If the maxNumberOfNamespaces is 1, then the printed function name will be ClassName::functionName().
- If the maxNumberOfNamespaces is 2, then the printed function name will be ProjectName::ClassName::functionName().
- If the maxNumberOfNamespaces is 3, then the printed function name will be ProductName::ProjectName::ClassName::functionName().
- If the maxNumberOfNamespaces is 4, then the printed function name will be CompanyName::ProductName::ProjectName::ClassName::functionName().
- If the maxNumberOfNamespaces is 5, then the printed function name will still be CompanyName::ProductName::ProjectName::ClassName::functionName().
Usually the values that make the most sense are:
- UINT_MAX (the fully qualified function name including all namespaces)
- 0 (just the function name itself)
- 1 (for class member functions this means the function name and the class name, but no namespaces, while for free functions it means the function name and the name of the most inner namespace, but not the names of any other namespaces)
- Parameters
-
maxNumberOfNamespaces | the maximum number of namespaces |
- See also
- getAddFunction(), setAddFunction(), getMaxNumberOfNamespaces()
◆ getAddLine()
bool getAddLine |
( |
void |
| ) |
const |
- Returns
- 'true', if log lines are prefixed with the line of the EGLOG() call, 'false' otherwise.
- See also
- setAddLine()
◆ setAddLine()
Sets the value of the AddLine flag. The default value of this flag is 'true'.
- Parameters
-
addLine | 'true' instructs the Logger instance to prefix log lines with the line of the EGLOG() call, 'false' prevents it from doing so. |
- See also
- getAddLine()
◆ toString() [1/3]
- Parameters
-
retStr | reference to a string, to store the return-value in; the information, which is generated by this function, will be attached at the end of any eventually existing previous content of the string |
withTypes | set to true, to include type information in the generated string |
- Returns
- a JString representation of the instance and its contents for debugging purposes.
Implements ToString.
◆ toString() [2/3]
- Parameters
-
retStr | reference to a string, to store the return-value in; the information, which is generated by this function, will be attached at the end of any eventually existing previous content of the string |
withTypes | set to true, to include type information in the generated string |
- Returns
- a JString representation of the instance and its contents for debugging purposes.
◆ toString() [3/3]
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
- Parameters
-
withTypes | set to true, to include type information in the generated string |
- Returns
- a JString representation of the instance and its contents for debugging purposes.
- See also
- JString