summaryrefslogtreecommitdiffstats
path: root/lib/shadowlog.c
blob: 7bcc63cab0441afd9c82ea4a0951d6f1de67a2e7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#include "shadowlog.h"

#include "lib/shadowlog_internal.h"

const char *shadow_progname = "libshadow";
FILE *shadow_logfd = NULL;

void log_set_progname(const char *progname)
{
	shadow_progname = progname;
}

const char *log_get_progname(void)
{
	return shadow_progname;
}

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;
}