/src/pjsip/third_party/srtp/pjlib/srtp_err.c
Line | Count | Source |
1 | | /* |
2 | | * Copyright (C) 2003-2007 Benny Prijono <benny@prijono.org> |
3 | | * |
4 | | * This program is free software; you can redistribute it and/or modify |
5 | | * it under the terms of the GNU General Public License as published by |
6 | | * the Free Software Foundation; either version 2 of the License, or |
7 | | * (at your option) any later version. |
8 | | * |
9 | | * This program is distributed in the hope that it will be useful, |
10 | | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 | | * GNU General Public License for more details. |
13 | | * |
14 | | * You should have received a copy of the GNU General Public License |
15 | | * along with this program; if not, write to the Free Software |
16 | | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
17 | | */ |
18 | | #include "err.h" |
19 | | #include <pj/log.h> |
20 | | |
21 | | /* Redirect libsrtp error to PJ_LOG */ |
22 | | |
23 | | static srtp_err_reporting_level_t err_level = srtp_err_level_error; |
24 | | |
25 | | void srtp_err_report(srtp_err_reporting_level_t priority, const char *format, ...) |
26 | 0 | { |
27 | 0 | va_list args; |
28 | |
|
29 | 0 | #if PJ_LOG_MAX_LEVEL >= 1 |
30 | 0 | if (priority <= err_level) { |
31 | |
|
32 | 0 | va_start(args, format); |
33 | 0 | pj_log("libsrtp", priority, format, args); |
34 | 0 | va_end(args); |
35 | 0 | } |
36 | 0 | #endif |
37 | 0 | } |
38 | | |
39 | | void srtp_err_reporting_set_level(srtp_err_reporting_level_t lvl) |
40 | 0 | { |
41 | 0 | err_level = lvl; |
42 | 0 | } |
43 | | |
44 | | srtp_err_status_t srtp_err_reporting_init(void) |
45 | 3.10k | { |
46 | 3.10k | return srtp_err_status_ok; |
47 | 3.10k | } |
48 | | |
49 | | srtp_err_status_t srtp_install_err_report_handler(srtp_err_report_handler_func_t func) |
50 | 0 | { |
51 | 0 | PJ_UNUSED_ARG(func); |
52 | 0 | return srtp_err_status_ok; |
53 | 0 | } |