Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset 20dd67e in mainline for uspace/lib/usb/include/usb/debug.h


Ignore:
Timestamp:
2012-08-17T13:40:22Z (9 years ago)
Author:
Vojtech Horky <vojtechhorky@…>
Branches:
lfn, master
Children:
920d0fc
Parents:
267f235
Message:

USB logging uses standard logging

File:
1 edited

Legend:

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

    r267f235 r20dd67e  
    3838#include <inttypes.h>
    3939#include <usb/usb.h>
     40#include <io/log.h>
    4041#include <assert.h>
    4142
     
    4344    const uint8_t *, size_t);
    4445
    45 /** Logging level. */
    46 typedef enum {
    47         /** Fatal, unrecoverable, error.
    48          * Such error prevents the driver from working at all.
    49          */
    50         USB_LOG_LEVEL_FATAL,
    51 
    52         /** Serious but recoverable error
    53          * Shall be used for errors fatal for single device but not for
    54          * driver itself.
    55          */
    56         USB_LOG_LEVEL_ERROR,
    57 
    58         /** Warning.
    59          * Problems from which the driver is able to recover gracefully.
    60          */
    61         USB_LOG_LEVEL_WARNING,
    62 
    63         /** Information message.
    64          * This should be the last level that is printed by default to
    65          * the screen.
    66          * Typical usage is to inform that new device was found and what
    67          * are its capabilities.
    68          * Do not use for repetitive actions (such as device polling).
    69          */
    70         USB_LOG_LEVEL_INFO,
    71 
    72         /** Debugging message. */
    73         USB_LOG_LEVEL_DEBUG,
    74 
    75         /** More detailed debugging message. */
    76         USB_LOG_LEVEL_DEBUG2,
    77 
    78         /** Terminating constant for logging levels. */
    79         USB_LOG_LEVEL_MAX
    80 } usb_log_level_t;
     46#define USB_LOG_LEVEL_FATAL LVL_FATAL
     47#define USB_LOG_LEVEL_ERROR LVL_ERROR
     48#define USB_LOG_LEVEL_WARNING LVL_WARN
     49#define USB_LOG_LEVEL_INFO LVL_NOTE
     50#define USB_LOG_LEVEL_DEBUG LVL_DEBUG
     51#define USB_LOG_LEVEL_DEBUG2 LVL_DEBUG2
    8152
    8253/** Default log level. */
     
    8758#endif
    8859
    89 void usb_log_enable(usb_log_level_t, const char *);
     60void usb_log_enable(log_level_t , const char *);
    9061
    91 void usb_log_printf(usb_log_level_t, const char *, ...)
     62void usb_log_printf(log_level_t, const char *, ...)
    9263        PRINTF_ATTRIBUTE(2, 3);
    9364
Note: See TracChangeset for help on using the changeset viewer.