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
67f9bd20
Commit
67f9bd20
authored
Jan 18, 2016
by
Gautier Pelloux-Prayer
Browse files
linphonecore.c: since log level is a mask, do not compare with == operator but & instead
parent
edfa2cc3
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
42 additions
and
44 deletions
+42
-44
coreapi/linphonecore.c
coreapi/linphonecore.c
+13
-43
coreapi/linphonecore.h
coreapi/linphonecore.h
+28
-0
oRTP
oRTP
+1
-1
No files found.
coreapi/linphonecore.c
View file @
67f9bd20
...
...
@@ -287,24 +287,19 @@ static void linphone_core_log_collection_handler(OrtpLogLevel level, const char
ortp_gettimeofday
(
&
tp
,
NULL
);
tt
=
(
time_t
)
tp
.
tv_sec
;
lt
=
localtime
((
const
time_t
*
)
&
tt
);
switch
(
level
){
case
ORTP_DEBUG
:
lname
=
"DEBUG"
;
break
;
case
ORTP_MESSAGE
:
lname
=
"MESSAGE"
;
break
;
case
ORTP_WARNING
:
lname
=
"WARNING"
;
break
;
case
ORTP_ERROR
:
lname
=
"ERROR"
;
break
;
case
ORTP_FATAL
:
lname
=
"FATAL"
;
break
;
default:
ortp_fatal
(
"Bad level !"
);
if
((
level
&
ORTP_DEBUG
)
!=
0
)
{
lname
=
"DEBUG"
;
}
else
if
((
level
&
ORTP_MESSAGE
)
!=
0
)
{
lname
=
"MESSAGE"
;
}
else
if
((
level
&
ORTP_WARNING
)
!=
0
)
{
lname
=
"WARNING"
;
}
else
if
((
level
&
ORTP_ERROR
)
!=
0
)
{
lname
=
"ERROR"
;
}
else
if
((
level
&
ORTP_FATAL
)
!=
0
)
{
lname
=
"FATAL"
;
}
else
{
ortp_fatal
(
"Bad level !"
);
}
msg
=
ortp_strdup_vprintf
(
fmt
,
args
);
...
...
@@ -725,42 +720,17 @@ void linphone_core_reset_log_collection(void) {
ortp_mutex_unlock
(
&
liblinphone_log_collection_mutex
);
}
/**
* Enable logs in supplied FILE*.
*
* @ingroup misc
* @deprecated Use #linphone_core_set_log_file and #linphone_core_set_log_level instead.
*
* @param file a C FILE* where to fprintf logs. If null stdout is used.
*
**/
void
linphone_core_enable_logs
(
FILE
*
file
){
if
(
file
==
NULL
)
file
=
stdout
;
ortp_set_log_file
(
file
);
linphone_core_set_log_level
(
ORTP_MESSAGE
);
}
/**
* Enable logs through the user's supplied log callback.
*
* @ingroup misc
* @deprecated Use #linphone_core_set_log_handler and #linphone_core_set_log_level instead.
*
* @param logfunc The address of a OrtpLogFunc callback whose protoype is
* typedef void (*OrtpLogFunc)(OrtpLogLevel lev, const char *fmt, va_list args);
*
**/
void
linphone_core_enable_logs_with_cb
(
OrtpLogFunc
logfunc
){
linphone_core_set_log_level
(
ORTP_MESSAGE
);
linphone_core_set_log_handler
(
logfunc
);
}
/**
* Entirely disable logging.
*
* @ingroup misc
* @deprecated Use #linphone_core_set_log_level instead.
**/
void
linphone_core_disable_logs
(
void
){
linphone_core_set_log_level
(
ORTP_ERROR
);
}
...
...
coreapi/linphonecore.h
View file @
67f9bd20
...
...
@@ -2303,8 +2303,36 @@ LINPHONE_PUBLIC void linphone_core_set_log_level(OrtpLogLevel loglevel);
* @param loglevel A bitmask of the log levels to set.
*/
LINPHONE_PUBLIC
void
linphone_core_set_log_level_mask
(
OrtpLogLevel
loglevel
);
/**
* Enable logs in supplied FILE*.
*
* @ingroup misc
* @deprecated Use #linphone_core_set_log_file and #linphone_core_set_log_level instead.
*
* @param file a C FILE* where to fprintf logs. If null stdout is used.
*
**/
LINPHONE_PUBLIC
void
linphone_core_enable_logs
(
FILE
*
file
);
/**
* Enable logs through the user's supplied log callback.
*
* @ingroup misc
* @deprecated Use #linphone_core_set_log_handler and #linphone_core_set_log_level instead.
*
* @param logfunc The address of a OrtpLogFunc callback whose protoype is
* typedef void (*OrtpLogFunc)(OrtpLogLevel lev, const char *fmt, va_list args);
*
**/
LINPHONE_PUBLIC
void
linphone_core_enable_logs_with_cb
(
OrtpLogFunc
logfunc
);
/**
* Entirely disable logging.
*
* @ingroup misc
* @deprecated Use #linphone_core_set_log_level instead.
**/
LINPHONE_PUBLIC
void
linphone_core_disable_logs
(
void
);
/**
...
...
oRTP
@
761cfd7c
Subproject commit
16848a37aa9c0231a8fd0bfd201b05ebaae81fff
Subproject commit
761cfd7c0eb76359b0dabeffd6533071b41a2914
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