mirror of git://git.sysmocom.de/ofono
Update log and plugin functions
This commit is contained in:
parent
ed6c14243d
commit
488463da5a
|
@ -32,9 +32,12 @@ extern "C" {
|
|||
* @short_description: Functions for logging error and debug information
|
||||
*/
|
||||
|
||||
extern void ofono_info(const char *format, ...);
|
||||
extern void ofono_error(const char *format, ...);
|
||||
extern void ofono_debug(const char *format, ...);
|
||||
extern void ofono_info(const char *format, ...)
|
||||
__attribute__((format(printf, 1, 2)));
|
||||
extern void ofono_error(const char *format, ...)
|
||||
__attribute__((format(printf, 1, 2)));
|
||||
extern void ofono_debug(const char *format, ...)
|
||||
__attribute__((format(printf, 1, 2)));
|
||||
|
||||
/**
|
||||
* DBG:
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
*
|
||||
* oFono - Open Telephony stack for Linux
|
||||
* oFono - Open Source Telephony
|
||||
*
|
||||
* Copyright (C) 2008-2009 Intel Corporation. All rights reserved.
|
||||
*
|
||||
|
|
17
src/log.c
17
src/log.c
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
*
|
||||
* oFono - Open Telephony stack for Linux
|
||||
* oFono - Open Source Telephony
|
||||
*
|
||||
* Copyright (C) 2008-2009 Intel Corporation. All rights reserved.
|
||||
*
|
||||
|
@ -90,15 +90,26 @@ void ofono_debug(const char *format, ...)
|
|||
va_end(ap);
|
||||
}
|
||||
|
||||
int __ofono_log_init(void)
|
||||
void __ofono_toggle_debug(void)
|
||||
{
|
||||
if (debug_enabled == TRUE)
|
||||
debug_enabled = FALSE;
|
||||
else
|
||||
debug_enabled = TRUE;
|
||||
}
|
||||
|
||||
int __ofono_log_init(gboolean detach, gboolean debug)
|
||||
{
|
||||
int option = LOG_NDELAY | LOG_PID;
|
||||
|
||||
if (detach == FALSE)
|
||||
option |= LOG_PERROR;
|
||||
|
||||
openlog("ofonod", option, LOG_DAEMON);
|
||||
|
||||
syslog(LOG_INFO, "oFono version %s", VERSION);
|
||||
|
||||
debug_enabled = TRUE;
|
||||
debug_enabled = debug;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
*
|
||||
* oFono - Open Telephony stack for Linux
|
||||
* oFono - Open Source Telephony
|
||||
*
|
||||
* Copyright (C) 2008-2009 Intel Corporation. All rights reserved.
|
||||
*
|
||||
|
|
Loading…
Reference in New Issue