libcamera
v0.0.0
Supporting cameras in Linux since 2019
|
Logging management. More...
Go to the source code of this file.
Enumerations | |
enum | libcamera::LoggingTarget { libcamera::LoggingTargetNone , libcamera::LoggingTargetSyslog , libcamera::LoggingTargetFile , libcamera::LoggingTargetStream } |
Log destination type. More... | |
Functions | |
int | libcamera::logSetFile (const char *path) |
Direct logging to a file. More... | |
int | libcamera::logSetStream (std::ostream *stream) |
Direct logging to a stream. More... | |
int | libcamera::logSetTarget (LoggingTarget target) |
Set the logging target. More... | |
void | libcamera::logSetLevel (const char *category, const char *level) |
Set the log level. More... | |
Logging management.
API to change the logging output destination and log levels programatically.
Log destination type.
Enumerator | |
---|---|
LoggingTargetNone | No logging destination.
|
LoggingTargetSyslog | Log to syslog.
|
LoggingTargetFile | Log to file.
|
LoggingTargetStream | Log to stream.
|
int libcamera::logSetFile | ( | const char * | path | ) |
Direct logging to a file.
[in] | path | Full path to the log file |
This function directs the log output to the file identified by path. The previous log target, if any, is closed, and all new log messages will be written to the new log file.
If the function returns an error, the log target is not changed.
void libcamera::logSetLevel | ( | const char * | category, |
const char * | level | ||
) |
Set the log level.
[in] | category | Logging category |
[in] | level | Log level |
This function sets the log level of category to level. level shall be one of the following strings:
"*" is not a valid category for this function.
int libcamera::logSetStream | ( | std::ostream * | stream | ) |
Direct logging to a stream.
[in] | stream | Stream to send log output to |
This function directs the log output to stream. The previous log target, if any, is closed, and all new log messages will be written to the new log stream.
If the function returns an error, the log file is not changed
int libcamera::logSetTarget | ( | LoggingTarget | target | ) |
Set the logging target.
[in] | target | Logging destination |
This function sets the logging output to the target specified by target. The allowed values of target are LoggingTargetNone and LoggingTargetSyslog. LoggingTargetNone will send the log output to nowhere, and LoggingTargetSyslog will send the log output to syslog. The previous log target, if any, is closed, and all new log messages will be written to the new log destination.
LoggingTargetFile and LoggingTargetStream are not valid values for target. Use logSetFile() and logSetStream() instead, respectively.
If the function returns an error, the log file is not changed.