Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
BC
public
liblinphone
Commits
574ed8e5
Commit
574ed8e5
authored
Aug 06, 2014
by
Ghislain MARY
Browse files
Add API to activate the serialization of logs.
parent
b17cab31
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
5 deletions
+24
-5
coreapi/linphonecore.c
coreapi/linphonecore.c
+15
-4
coreapi/linphonecore.h
coreapi/linphonecore.h
+8
-0
oRTP
oRTP
+1
-1
No files found.
coreapi/linphonecore.c
View file @
574ed8e5
...
...
@@ -64,6 +64,7 @@ static const char *liblinphone_version=
LIBLINPHONE_VERSION
#endif
;
static
bool_t
liblinphone_serialize_logs
=
FALSE
;
static
void
set_network_reachable
(
LinphoneCore
*
lc
,
bool_t
isReachable
,
time_t
curtime
);
static
void
linphone_core_run_hooks
(
LinphoneCore
*
lc
);
static
void
linphone_core_free_hooks
(
LinphoneCore
*
lc
);
...
...
@@ -480,11 +481,15 @@ void linphone_core_enable_logs_with_cb(OrtpLogFunc logfunc){
* @ingroup misc
* @deprecated Use #linphone_core_set_log_level instead.
**/
void
linphone_core_disable_logs
(){
void
linphone_core_disable_logs
(
void
){
ortp_set_log_level_mask
(
ORTP_ERROR
|
ORTP_FATAL
);
sal_disable_logs
();
}
void
linphone_core_serialize_logs
(
void
)
{
liblinphone_serialize_logs
=
TRUE
;
}
static
void
net_config_read
(
LinphoneCore
*
lc
)
{
...
...
@@ -1331,7 +1336,9 @@ static void linphone_core_init(LinphoneCore * lc, const LinphoneCoreVTable *vtab
linphone_core_set_state
(
lc
,
LinphoneGlobalStartup
,
"Starting up"
);
ortp_init
();
ortp_set_log_thread_id
(
ortp_thread_self
());
if
(
liblinphone_serialize_logs
==
TRUE
)
{
ortp_set_log_thread_id
(
ortp_thread_self
());
}
lc
->
dyn_pt
=
96
;
lc
->
default_profile
=
rtp_profile_new
(
"default profile"
);
linphone_core_assign_payload_type
(
lc
,
&
payload_type_pcmu8000
,
0
,
NULL
);
...
...
@@ -2397,7 +2404,9 @@ void linphone_core_iterate(LinphoneCore *lc){
}
}
ortp_logv_flush
();
if
(
liblinphone_serialize_logs
==
TRUE
)
{
ortp_logv_flush
();
}
}
/**
...
...
@@ -6038,7 +6047,9 @@ static void linphone_core_uninit(LinphoneCore *lc)
linphone_core_message_storage_close
(
lc
);
ms_exit
();
linphone_core_set_state
(
lc
,
LinphoneGlobalOff
,
"Off"
);
ortp_set_log_thread_id
(
0
);
if
(
liblinphone_serialize_logs
==
TRUE
)
{
ortp_set_log_thread_id
(
0
);
}
}
static
void
set_network_reachable
(
LinphoneCore
*
lc
,
bool_t
isReachable
,
time_t
curtime
){
...
...
coreapi/linphonecore.h
View file @
574ed8e5
...
...
@@ -1674,6 +1674,14 @@ LINPHONE_PUBLIC void linphone_core_set_log_level(OrtpLogLevel loglevel);
LINPHONE_PUBLIC
void
linphone_core_enable_logs
(
FILE
*
file
);
LINPHONE_PUBLIC
void
linphone_core_enable_logs_with_cb
(
OrtpLogFunc
logfunc
);
LINPHONE_PUBLIC
void
linphone_core_disable_logs
(
void
);
/**
* Enable logs serialization (output logs from either the thread that creates the linphone core or the thread that calls linphone_core_iterate()).
* Must be called before creating the linphone core.
* @ingroup misc
*/
LINPHONE_PUBLIC
void
linphone_core_serialize_logs
(
void
);
LINPHONE_PUBLIC
const
char
*
linphone_core_get_version
(
void
);
LINPHONE_PUBLIC
const
char
*
linphone_core_get_user_agent
(
LinphoneCore
*
lc
);
/**
...
...
oRTP
@
dfb505d7
Subproject commit
fc8d8457eb630907eff50333ddf5243b448fe73
3
Subproject commit
dfb505d7198dc8be59919c8c6d68add302a98fd
3
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment