Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Librem5
lurch
Commits
9d50ec2c
Commit
9d50ec2c
authored
Jun 03, 2017
by
Olivier Mehani
Browse files
Report AXC error through purple_debug
Signed-off-by:
Olivier Mehani
<
shtrom@ssji.net
>
parent
3a672b12
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/lurch.c
View file @
9d50ec2c
...
@@ -182,6 +182,37 @@ static char * lurch_uname_strip(const char * uname) {
...
@@ -182,6 +182,37 @@ static char * lurch_uname_strip(const char * uname) {
return
stripped
;
return
stripped
;
}
}
/**
* Log wrapper for AXC
*
* @param level an AXC_LOG level
* @param msg the log message
* @param len the length of the message
* @param ctx_p the axc context
*/
static
void
lurch_axc_log_func
(
int
level
,
const
char
*
msg
,
size_t
len
,
void
*
user_data
)
{
switch
(
level
)
{
case
AXC_LOG_ERROR
:
purple_debug_error
(
"lurch"
,
"[AXC ERROR] %s"
,
msg
);
case
AXC_LOG_WARNING
:
purple_debug_warning
(
"lurch"
,
"[AXC WARNING] %s"
,
msg
);
break
;
case
AXC_LOG_NOTICE
:
purple_debug_info
(
"lurch"
,
"[AXC NOTICE] %s"
,
msg
);
break
;
case
AXC_LOG_INFO
:
purple_debug_info
(
"lurch"
,
"[AXC INFO] %s"
,
msg
);
break
;
case
AXC_LOG_DEBUG
:
purple_debug_misc
(
"lurch"
,
"[AXC DEBUG] %s"
,
msg
);
break
;
default:
purple_debug_misc
(
"lurch"
,
"[AXC %d] %s"
,
level
,
msg
);
break
;
}
}
/**
/**
* Creates and initializes the axc context.
* Creates and initializes the axc context.
*
*
...
@@ -202,6 +233,8 @@ static int lurch_axc_get_init_ctx(char * uname, axc_context ** ctx_pp) {
...
@@ -202,6 +233,8 @@ static int lurch_axc_get_init_ctx(char * uname, axc_context ** ctx_pp) {
goto
cleanup
;
goto
cleanup
;
}
}
axc_context_set_log_func
(
ctx_p
,
lurch_axc_log_func
);
db_fn
=
lurch_uname_get_db_fn
(
uname
,
LURCH_DB_NAME_AXC
);
db_fn
=
lurch_uname_get_db_fn
(
uname
,
LURCH_DB_NAME_AXC
);
ret_val
=
axc_context_set_db_fn
(
ctx_p
,
db_fn
,
strlen
(
db_fn
));
ret_val
=
axc_context_set_db_fn
(
ctx_p
,
db_fn
,
strlen
(
db_fn
));
if
(
ret_val
)
{
if
(
ret_val
)
{
...
...
Write
Preview
Supports
Markdown
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