Debugging primitives.
More...
|
static void | __debug_print_header (const char *file, const char *fun, int line, short log_level, char *header) |
| Prints the correct header for the given debug level. More...
|
|
void | dbg_putchar (char c) |
| Prints the given character to debug output. More...
|
|
void | dbg_puts (const char *s) |
| Prints the given string to debug output. More...
|
|
void | set_log_level (int level) |
| Sets the loglevel. More...
|
|
int | get_log_level (void) |
| Returns the current loglevel. More...
|
|
void | dbg_printf (const char *file, const char *fun, int line, char *header, short log_level, const char *format,...) |
| Prints the given string to the debug output. More...
|
|
const char * | to_human_size (unsigned long bytes) |
| Transforms the given amount of bytes to a readable string. More...
|
|
const char * | dec_to_binary (unsigned long value, unsigned length) |
| Transforms the given value to a binary string. More...
|
|
Debugging primitives.
- Copyright
- (c) 2014-2024 This file is distributed under the MIT License. See LICENSE.md for details.
◆ __debug_print_header()
static void __debug_print_header |
( |
const char * |
file, |
|
|
const char * |
fun, |
|
|
int |
line, |
|
|
short |
log_level, |
|
|
char * |
header |
|
) |
| |
|
inlinestatic |
Prints the correct header for the given debug level.
- Parameters
-
file | the file origin of the debug message. |
fun | the function where the debug message was called. |
line | the line in the file where debug message was called. |
log_level | the log level. |
header | the header we want to show. |
◆ dbg_printf()
void dbg_printf |
( |
const char * |
file, |
|
|
const char * |
fun, |
|
|
int |
line, |
|
|
char * |
header, |
|
|
short |
log_level, |
|
|
const char * |
format, |
|
|
|
... |
|
) |
| |
Prints the given string to the debug output.
- Parameters
-
file | the name of the file. |
fun | the name of the function. |
line | the line inside the file. |
header | the header to print. |
log_level | the log level. |
format | the format to used, see printf. |
... | the list of arguments. |
◆ dbg_putchar()
void dbg_putchar |
( |
char |
c | ) |
|
Prints the given character to debug output.
- Parameters
-
◆ dbg_puts()
void dbg_puts |
( |
const char * |
s | ) |
|
Prints the given string to debug output.
- Parameters
-
◆ dec_to_binary()
const char* dec_to_binary |
( |
unsigned long |
value, |
|
|
unsigned |
length |
|
) |
| |
Transforms the given value to a binary string.
- Parameters
-
value | to print. |
length | of the binary output. |
- Returns
- String representing the binary value.
◆ get_log_level()
int get_log_level |
( |
void |
| ) |
|
Returns the current loglevel.
- Returns
- The current loglevel
◆ set_log_level()
void set_log_level |
( |
int |
level | ) |
|
Sets the loglevel.
- Parameters
-
◆ to_human_size()
const char* to_human_size |
( |
unsigned long |
bytes | ) |
|
Transforms the given amount of bytes to a readable string.
- Parameters
-
bytes | The bytes to turn to string. |
- Returns
- String representing the bytes in human readable form.