Changeset 9097c16a in mainline for uspace/lib/usb/include/usb/debug.h


Ignore:
Timestamp:
2011-02-04T13:14:14Z (13 years ago)
Author:
Lubos Slovak <lubos.slovak@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
9e7cdf8
Parents:
11797d5 (diff), ff244e6 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merged development

File:
1 edited

Legend:

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

    r11797d5 r9097c16a  
    11/*
    2  * Copyright (c) 2010 Vojtech Horky
     2 * Copyright (c) 2010-2011 Vojtech Horky
    33 * All rights reserved.
    44 *
     
    2727 */
    2828
    29 /** @addtogroup libusb usb
     29/** @addtogroup libusb
    3030 * @{
    3131 */
     
    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
     84/**
     85 * @}
     86 */
     87
Note: See TracChangeset for help on using the changeset viewer.