SDDC_Driver
Loading...
Searching...
No Matches
logging.h
1/*
2 * logging.h - logging functions
3 *
4 * Copyright (C) 2020 by Franco Venturi
5 *
6 * This program is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <https://www.gnu.org/licenses/>.
18 *
19 * SPDX-License-Identifier: GPL-3.0-or-later
20 */
21
22#ifndef __LOGGING_H
23#define __LOGGING_H
24
25#include <libusb.h>
26
27
28#ifdef __cplusplus
29extern "C" {
30#endif
31
32void log_error(const char *error_message, const char *function,
33 const char *file, int line);
34void log_usb_error(int usb_error_code, const char *function, const char *file,
35 int line);
36void log_usb_warning(int usb_error_code, const char *function, const char *file,
37 int line);
38
39#define USB_ERROR_PRINTLN(tag, usb_error_code) ErrorPrintln(tag, "libusb %s", libusb_strerror(usb_error_code))
40
41#ifdef __cplusplus
42}
43#endif
44
45#endif /* __LOGGING_H */