Changeset 8e9becf6 in mainline for uspace/lib/usb/include/usb/debug.h


Ignore:
Timestamp:
2011-03-08T20:00:47Z (13 years ago)
Author:
Lubos Slovak <lubos.slovak@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
021351c
Parents:
0588062e (diff), d2fc1c2 (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 branch lelian/hidd

File:
1 edited

Legend:

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

    r0588062e r8e9becf6  
    3131 */
    3232/** @file
    33  * @brief Debugging related functions.
     33 * Debugging related functions.
    3434 */
    3535#ifndef LIBUSB_DEBUG_H_
     
    3939#include <assert.h>
    4040
    41 void usb_dprintf(const char *tag, int level, const char *format, ...);
    42 void usb_dprintf_enable(const char *tag, int level);
    43 
    4441void usb_dump_standard_descriptor(FILE *, const char *, const char *,
    4542    const uint8_t *, size_t);
     
    4744/** Logging level. */
    4845typedef enum {
     46        /** Fatal, unrecoverable, error.
     47         * Such error prevents the driver from working at all.
     48         */
    4949        USB_LOG_LEVEL_FATAL,
     50
     51        /** Serious but recoverable error
     52         * Shall be used for errors fatal for single device but not for
     53         * driver itself.
     54         */
    5055        USB_LOG_LEVEL_ERROR,
     56
     57        /** Warning.
     58         * Problems from which the driver is able to recover gracefully.
     59         */
    5160        USB_LOG_LEVEL_WARNING,
     61
     62        /** Information message.
     63         * This should be the last level that is printed by default to
     64         * the screen.
     65         * Typical usage is to inform that new device was found and what
     66         * are its capabilities.
     67         * Do not use for repetitive actions (such as device polling).
     68         */
    5269        USB_LOG_LEVEL_INFO,
     70
     71        /** Debugging message. */
    5372        USB_LOG_LEVEL_DEBUG,
     73
     74        /** More detailed debugging message. */
    5475        USB_LOG_LEVEL_DEBUG2,
     76
     77        /** Terminating constant for logging levels. */
    5578        USB_LOG_LEVEL_MAX
    5679} usb_log_level_t;
     
    6184void usb_log_printf(usb_log_level_t, const char *, ...);
    6285
     86/** Log fatal error. */
    6387#define usb_log_fatal(format, ...) \
    6488        usb_log_printf(USB_LOG_LEVEL_FATAL, format, ##__VA_ARGS__)
    6589
     90/** Log normal (recoverable) error. */
    6691#define usb_log_error(format, ...) \
    6792        usb_log_printf(USB_LOG_LEVEL_ERROR, format, ##__VA_ARGS__)
    6893
     94/** Log warning. */
    6995#define usb_log_warning(format, ...) \
    7096        usb_log_printf(USB_LOG_LEVEL_WARNING, format, ##__VA_ARGS__)
    7197
     98/** Log informational message. */
    7299#define usb_log_info(format, ...) \
    73100        usb_log_printf(USB_LOG_LEVEL_INFO, format, ##__VA_ARGS__)
    74101
     102/** Log debugging message. */
    75103#define usb_log_debug(format, ...) \
    76104        usb_log_printf(USB_LOG_LEVEL_DEBUG, format, ##__VA_ARGS__)
    77105
     106/** Log verbose debugging message. */
    78107#define usb_log_debug2(format, ...) \
    79108        usb_log_printf(USB_LOG_LEVEL_DEBUG2, format, ##__VA_ARGS__)
    80109
     110const char *usb_debug_str_buffer(const uint8_t *, size_t, size_t);
    81111
    82112
Note: See TracChangeset for help on using the changeset viewer.