Logger client that redirects messages to a file.
More...
#include <geogram/basic/logger.h>
|
| FileLogger () |
| Creates an empty file logger. More...
|
|
| FileLogger (const std::string &file_name) |
| Creates logger that logs messages to a file. More...
|
|
void | div (const std::string &title) override |
| Creates a new division. More...
|
|
void | out (const std::string &str) override |
| Handles an information message. More...
|
|
void | warn (const std::string &str) override |
| Handles a warning message. More...
|
|
void | err (const std::string &str) override |
| Handles an error message. More...
|
|
void | status (const std::string &str) override |
| Handles a status message. More...
|
|
| ~LoggerClient () override |
| LoggerClient destructor.
|
|
void | ref () const |
| Increments the reference count. More...
|
|
void | unref () const |
| Decrements the reference count. More...
|
|
bool | is_shared () const |
| Check if the object is shared. More...
|
|
int | nb_refs () const |
| Gets the number of references that point to this object. More...
|
|
Logger client that redirects messages to a file.
Definition at line 248 of file logger.h.
◆ FileLogger() [1/2]
GEO::FileLogger::FileLogger |
( |
| ) |
|
Creates an empty file logger.
The default constructed file logger does not handle messages until it is set a filename with set_file_name()
◆ FileLogger() [2/2]
GEO::FileLogger::FileLogger |
( |
const std::string & |
file_name | ) |
|
Creates logger that logs messages to a file.
All sent to the file logger are sent to the file file_name
.
- Parameters
-
[in] | file_name | name of the log file |
◆ div()
void GEO::FileLogger::div |
( |
const std::string & |
title | ) |
|
|
overridevirtual |
Creates a new division.
This creates a new division entitled with title
- Parameters
-
[in] | title | the text of the title |
Implements GEO::LoggerClient.
◆ err()
void GEO::FileLogger::err |
( |
const std::string & |
str | ) |
|
|
overridevirtual |
Handles an error message.
- Parameters
-
[in] | str | the text of the message |
Implements GEO::LoggerClient.
◆ out()
void GEO::FileLogger::out |
( |
const std::string & |
str | ) |
|
|
overridevirtual |
Handles an information message.
- Parameters
-
[in] | str | the text of the message |
Implements GEO::LoggerClient.
◆ set_file_name()
void GEO::FileLogger::set_file_name |
( |
const std::string & |
file_name | ) |
|
|
protected |
Sets the log file name.
If the client already had a file name, the corresponding file stream is closed and reopened with file_name
.
- Parameters
-
[in] | file_name | the name of the log file |
◆ status()
void GEO::FileLogger::status |
( |
const std::string & |
str | ) |
|
|
overridevirtual |
Handles a status message.
- Parameters
-
[in] | str | the text of the message This function does actually nothing |
Implements GEO::LoggerClient.
◆ warn()
void GEO::FileLogger::warn |
( |
const std::string & |
str | ) |
|
|
overridevirtual |
Handles a warning message.
- Parameters
-
[in] | str | the text of the message |
Implements GEO::LoggerClient.
The documentation for this class was generated from the following file: