mirror of
https://github.com/samba-team/samba.git
synced 2025-07-29 15:42:04 +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:
@ -131,6 +131,13 @@ static int debug_level_to_priority(int level)
|
|||||||
* all active backends.
|
* 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 {
|
static struct debug_backend {
|
||||||
const char *name;
|
const char *name;
|
||||||
int log_level;
|
int log_level;
|
||||||
@ -138,6 +145,10 @@ static struct debug_backend {
|
|||||||
void (*reload)(bool enabled, bool prev_enabled, const char *prog_name);
|
void (*reload)(bool enabled, bool prev_enabled, const char *prog_name);
|
||||||
void (*log)(int msg_level, const char *msg, const char *msg_no_nl);
|
void (*log)(int msg_level, const char *msg, const char *msg_no_nl);
|
||||||
} debug_backends[] = {
|
} debug_backends[] = {
|
||||||
|
{
|
||||||
|
.name = "file",
|
||||||
|
.log = debug_file_log,
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct debug_backend *debug_find_backend(const char *name)
|
static struct debug_backend *debug_find_backend(const char *name)
|
||||||
|
Reference in New Issue
Block a user