2021-11-29 05:07:53 +05:30
|
|
|
#include "shadowlog.h"
|
|
|
|
|
|
|
|
#include "lib/shadowlog_internal.h"
|
|
|
|
|
2021-12-26 23:51:09 +05:30
|
|
|
const char *shadow_progname = "libshadow";
|
|
|
|
FILE *shadow_logfd = NULL;
|
2021-12-26 04:11:58 +05:30
|
|
|
|
2021-11-29 05:07:53 +05:30
|
|
|
void log_set_progname(const char *progname)
|
|
|
|
{
|
2021-12-26 04:11:58 +05:30
|
|
|
shadow_progname = progname;
|
2021-11-29 05:07:53 +05:30
|
|
|
}
|
|
|
|
|
|
|
|
const char *log_get_progname(void)
|
|
|
|
{
|
2021-12-26 04:11:58 +05:30
|
|
|
return shadow_progname;
|
2021-11-29 05:07:53 +05:30
|
|
|
}
|
|
|
|
|
|
|
|
void log_set_logfd(FILE *fd)
|
|
|
|
{
|
|
|
|
if (NULL != fd)
|
|
|
|
shadow_logfd = fd;
|
|
|
|
else
|
|
|
|
shadow_logfd = stderr;
|
|
|
|
}
|
|
|
|
|
|
|
|
FILE *log_get_logfd(void)
|
|
|
|
{
|
|
|
|
if (shadow_logfd != NULL)
|
|
|
|
return shadow_logfd;
|
|
|
|
return stderr;
|
|
|
|
}
|