1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-12 09:18:10 +03:00

debug: Add file backend

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
This commit is contained in:
Christof Schmitt 2015-01-09 14:00:02 -07:00
parent 289a7b41bc
commit 978fee84d0

View File

@ -131,6 +131,13 @@ static int debug_level_to_priority(int level)
* all active backends.
*/
static void debug_file_log(int msg_level,
const char *msg, const char *msg_no_nl)
{
check_log_size();
write(state.fd, msg, strlen(msg));
}
static struct debug_backend {
const char *name;
int log_level;
@ -138,6 +145,10 @@ static struct debug_backend {
void (*reload)(bool enabled, bool prev_enabled, const char *prog_name);
void (*log)(int msg_level, const char *msg, const char *msg_no_nl);
} debug_backends[] = {
{
.name = "file",
.log = debug_file_log,
},
};
static struct debug_backend *debug_find_backend(const char *name)