Changeset 8e9becf6 in mainline for uspace/lib/usb/include/usb/debug.h
- Timestamp:
- 2011-03-08T20:00:47Z (13 years ago)
- 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. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/usb/include/usb/debug.h
r0588062e r8e9becf6 31 31 */ 32 32 /** @file 33 * @briefDebugging related functions.33 * Debugging related functions. 34 34 */ 35 35 #ifndef LIBUSB_DEBUG_H_ … … 39 39 #include <assert.h> 40 40 41 void usb_dprintf(const char *tag, int level, const char *format, ...);42 void usb_dprintf_enable(const char *tag, int level);43 44 41 void usb_dump_standard_descriptor(FILE *, const char *, const char *, 45 42 const uint8_t *, size_t); … … 47 44 /** Logging level. */ 48 45 typedef enum { 46 /** Fatal, unrecoverable, error. 47 * Such error prevents the driver from working at all. 48 */ 49 49 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 */ 50 55 USB_LOG_LEVEL_ERROR, 56 57 /** Warning. 58 * Problems from which the driver is able to recover gracefully. 59 */ 51 60 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 */ 52 69 USB_LOG_LEVEL_INFO, 70 71 /** Debugging message. */ 53 72 USB_LOG_LEVEL_DEBUG, 73 74 /** More detailed debugging message. */ 54 75 USB_LOG_LEVEL_DEBUG2, 76 77 /** Terminating constant for logging levels. */ 55 78 USB_LOG_LEVEL_MAX 56 79 } usb_log_level_t; … … 61 84 void usb_log_printf(usb_log_level_t, const char *, ...); 62 85 86 /** Log fatal error. */ 63 87 #define usb_log_fatal(format, ...) \ 64 88 usb_log_printf(USB_LOG_LEVEL_FATAL, format, ##__VA_ARGS__) 65 89 90 /** Log normal (recoverable) error. */ 66 91 #define usb_log_error(format, ...) \ 67 92 usb_log_printf(USB_LOG_LEVEL_ERROR, format, ##__VA_ARGS__) 68 93 94 /** Log warning. */ 69 95 #define usb_log_warning(format, ...) \ 70 96 usb_log_printf(USB_LOG_LEVEL_WARNING, format, ##__VA_ARGS__) 71 97 98 /** Log informational message. */ 72 99 #define usb_log_info(format, ...) \ 73 100 usb_log_printf(USB_LOG_LEVEL_INFO, format, ##__VA_ARGS__) 74 101 102 /** Log debugging message. */ 75 103 #define usb_log_debug(format, ...) \ 76 104 usb_log_printf(USB_LOG_LEVEL_DEBUG, format, ##__VA_ARGS__) 77 105 106 /** Log verbose debugging message. */ 78 107 #define usb_log_debug2(format, ...) \ 79 108 usb_log_printf(USB_LOG_LEVEL_DEBUG2, format, ##__VA_ARGS__) 80 109 110 const char *usb_debug_str_buffer(const uint8_t *, size_t, size_t); 81 111 82 112
Note:
See TracChangeset
for help on using the changeset viewer.