Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/usb/include/usb/debug.h

    r3b77628 rec293a8  
    11/*
    2  * Copyright (c) 2010 Vojtech Horky
     2 * Copyright (c) 2010-2011 Vojtech Horky
    33 * All rights reserved.
    44 *
     
    3737#include <stdio.h>
    3838#include <usb/usb.h>
     39#include <assert.h>
    3940
    4041void usb_dprintf(const char *tag, int level, const char *format, ...);
     
    4445    const uint8_t *, size_t);
    4546
     47/** Logging level. */
     48typedef enum {
     49        USB_LOG_LEVEL_FATAL,
     50        USB_LOG_LEVEL_ERROR,
     51        USB_LOG_LEVEL_WARNING,
     52        USB_LOG_LEVEL_INFO,
     53        USB_LOG_LEVEL_DEBUG,
     54        USB_LOG_LEVEL_DEBUG2,
     55        USB_LOG_LEVEL_MAX
     56} usb_log_level_t;
     57
     58
     59void usb_log_enable(usb_log_level_t, const char *);
     60
     61void usb_log_printf(usb_log_level_t, const char *, ...);
     62
     63#define usb_log_fatal(format, ...) \
     64        usb_log_printf(USB_LOG_LEVEL_FATAL, format, ##__VA_ARGS__)
     65
     66#define usb_log_error(format, ...) \
     67        usb_log_printf(USB_LOG_LEVEL_ERROR, format, ##__VA_ARGS__)
     68
     69#define usb_log_warning(format, ...) \
     70        usb_log_printf(USB_LOG_LEVEL_WARNING, format, ##__VA_ARGS__)
     71
     72#define usb_log_info(format, ...) \
     73        usb_log_printf(USB_LOG_LEVEL_INFO, format, ##__VA_ARGS__)
     74
     75#define usb_log_debug(format, ...) \
     76        usb_log_printf(USB_LOG_LEVEL_DEBUG, format, ##__VA_ARGS__)
     77
     78#define usb_log_debug2(format, ...) \
     79        usb_log_printf(USB_LOG_LEVEL_DEBUG2, format, ##__VA_ARGS__)
     80
     81
     82
    4683#endif
    4784/**
Note: See TracChangeset for help on using the changeset viewer.