Changeset efdfebc in mainline for uspace/lib/usb/include/usb/debug.h
- Timestamp:
- 2012-11-06T21:03:44Z (11 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 338810f
- Parents:
- de73242 (diff), 94795812 (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
rde73242 refdfebc 38 38 #include <inttypes.h> 39 39 #include <usb/usb.h> 40 #include <io/log.h> 40 41 #include <assert.h> 41 42 … … 43 44 const uint8_t *, size_t); 44 45 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, 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 51 52 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; 81 82 /** Default log level. */ 83 #ifdef CONFIG_USB_VERBOSE 84 #define USB_LOG_LEVEL_DEFAULT USB_LOG_LEVEL_DEBUG 85 #else 86 #define USB_LOG_LEVEL_DEFAULT USB_LOG_LEVEL_INFO 87 #endif 88 89 void usb_log_enable(usb_log_level_t, const char *); 90 91 void usb_log_printf(usb_log_level_t, const char *, ...) 92 PRINTF_ATTRIBUTE(2, 3); 53 #define usb_log_printf(level, format, ...) \ 54 log_msg(LOG_DEFAULT, level, format, ##__VA_ARGS__) 93 55 94 56 /** Log fatal error. */
Note:
See TracChangeset
for help on using the changeset viewer.