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
7675f717
Commit
7675f717
authored
May 09, 2017
by
Benjamin REIS
Browse files
add default log handler for xamarin IOS
parent
5fb392bc
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
45 additions
and
0 deletions
+45
-0
coreapi/CMakeLists.txt
coreapi/CMakeLists.txt
+1
-0
coreapi/linphonecore_ios.cc
coreapi/linphonecore_ios.cc
+44
-0
No files found.
coreapi/CMakeLists.txt
View file @
7675f717
...
...
@@ -128,6 +128,7 @@ endif()
set
(
LINPHONE_SOURCE_FILES_OBJC
)
if
(
IOS
)
list
(
APPEND LINPHONE_SOURCE_FILES_OBJC ringtoneplayer_ios.m ringtoneplayer_ios.h
)
list
(
APPEND LINPHONE_SOURCE_FILES_CXX linphonecore_ios.cc
)
endif
()
...
...
coreapi/linphonecore_ios.cc
0 → 100644
View file @
7675f717
#include <stdio.h>
#include "linphone/core.h"
#ifdef __APPLE__
#include "TargetConditionals.h"
#endif
#if TARGET_OS_IPHONE
static
void
linphone_iphone_log_handler
(
const
char
*
domain
,
OrtpLogLevel
lev
,
const
char
*
fmt
,
va_list
args
)
{
char
*
str
=
bctbx_strdup_vprintf
(
fmt
,
args
);
const
char
*
levname
=
"undef"
;
if
(
!
domain
)
domain
=
"lib"
;
switch
(
lev
)
{
case
ORTP_FATAL
:
levname
=
"Fatal"
;
break
;
case
ORTP_ERROR
:
levname
=
"Error"
;
break
;
case
ORTP_WARNING
:
levname
=
"Warning"
;
break
;
case
ORTP_MESSAGE
:
levname
=
"Message"
;
break
;
case
ORTP_DEBUG
:
levname
=
"Debug"
;
break
;
case
ORTP_TRACE
:
levname
=
"Trace"
;
break
;
case
ORTP_LOGLEV_END
:
return
;
}
fprintf
(
stdout
,
"[%s] %s"
,
levname
,
str
);
}
extern
"C"
void
linphone_iphone_enable_logs
()
{
linphone_core_enable_logs_with_cb
(
linphone_iphone_log_handler
);
}
#endif
\ No newline at end of file
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