Skip to content
Snippets Groups Projects
Commit 67c6a6e6 authored by Alexander Turenko's avatar Alexander Turenko Committed by Kirill Yukhin
Browse files

say: allow to set a logger file descriptor


It is necessary to decouple stderr from a logger file descriptor in the
popen implementation.

Part of #4031

Acked-by: default avatarCyrill Gorcunov <gorcunov@gmail.com>
parent 16c83356
No related branches found
No related tags found
No related merge requests found
......@@ -174,6 +174,12 @@ log_get_fd(void)
return log_default->fd;
}
void
log_set_fd(int new_fd)
{
log_default->fd = new_fd;
}
void
log_set_level(struct log *log, enum say_level level)
{
......
......@@ -204,10 +204,18 @@ enum say_logger_type
log_type();
/**
* Default logger file descriptor.
* Accessors for default logger file descriptor.
*
* It is needed for decoupling of a logger file descriptor from
* stderr in the popen implementation.
*
* Those functions break logger incapsulation, so use them with
* caution.
*/
int
log_get_fd(void);
void
log_set_fd(int new_fd);
/**
* Set log level. Can be used dynamically.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment