debug.c File Reference

Debugging and logging support. More...

#include <adt/list.h>
#include <fibril_synch.h>
#include <errno.h>
#include <stdlib.h>
#include <stdio.h>
#include <usb/debug.h>

Go to the source code of this file.

Defines

#define BUFFER_DUMP_GROUP_SIZE   4
 How many bytes to group together.
#define BUFFER_DUMP_LEN   240
 Size of the string for buffer dumps.
#define REMAINDER_STR_FMT   " (%zu)..."
#define REMAINDER_STR_LEN   (5 + 1 + 10)

Functions

static FIBRIL_MUTEX_INITIALIZE (log_serializer)
 Serialization mutex for logging functions.
static const char * log_level_name (usb_log_level_t level)
 Get log level name prefix.
const char * usb_debug_str_buffer (const uint8_t *buffer, size_t size, size_t dumped_size)
 Dump buffer into string.
void usb_log_enable (usb_log_level_t level, const char *message_prefix)
 Enable logging.
void usb_log_printf (usb_log_level_t level, const char *format,...)
 Print logging message.

Variables

static fibril_local char buffer_dump [2][BUFFER_DUMP_LEN]
 Fibril local storage for the dumped buffer.
static fibril_local int buffer_dump_index = 0
 Fibril local storage for buffer switching.
static usb_log_level_t log_level = USB_LOG_LEVEL_WARNING
 Level of logging messages.
static const char * log_prefix = "usb"
 Prefix for logging messages.
static FILElog_stream = NULL
 File where to store the log.


Detailed Description

Debugging and logging support.

Definition in file debug.c.


Generated on Thu Jun 2 07:45:54 2011 for HelenOS/USB by  doxygen 1.4.7