KOS's Logging API
More...
KOS's Logging API
◆ DBGIO_MODE_IRQ
◆ DBGIO_MODE_POLLED
#define DBGIO_MODE_POLLED 0 |
◆ dbgio_dev_get()
const char * dbgio_dev_get |
( |
void | | ) |
|
Fetch the name of the currently selected dbgio interface.
- Returns
- The name of the current dbgio interface (or NULL if no device is selected)
◆ dbgio_dev_select()
int dbgio_dev_select |
( |
const char * | name | ) |
|
Select a new dbgio interface by name.
This function manually selects a new dbgio interface by name. This function will allow you to select a device, even if it is not detected.
- Parameters
-
name | The dbgio interface to select |
- Return values
-
- Error Conditions:
- ENODEV - The specified device could not be initialized
◆ dbgio_disable()
void dbgio_disable |
( |
void | | ) |
|
Disable debug I/O globally.
◆ dbgio_enable()
void dbgio_enable |
( |
void | | ) |
|
Enable debug I/O globally.
◆ dbgio_flush()
Flush any queued output.
- Return values
-
0 | On success |
-1 | On error (errno should be set as appropriate) |
◆ dbgio_init()
Initialize the dbgio console.
This function is called internally, and shouldn't need to be called by any user programs.
- Return values
-
- Error Conditions:
- ENODEV - No devices could be detected/initialized
◆ dbgio_printf()
int dbgio_printf |
( |
const char * | fmt, |
|
|
| ... ) |
Built-in debug I/O printf function.
- Parameters
-
fmt | A printf() style format string |
... | Format arguments |
- Returns
- The number of bytes written, or <0 on error (errno should be set as appropriate)
◆ dbgio_read()
Read one character from the console.
- Return values
-
0 | On success |
-1 | On error (errno should be set as appropriate) |
◆ dbgio_read_buffer()
int dbgio_read_buffer |
( |
uint8 * | data, |
|
|
int | len ) |
Read an entire buffer of data from the console.
- Parameters
-
data | The buffer to read into |
len | The length of the buffer |
- Returns
- Number of characters read on success, or -1 on failure (errno should be set as appropriate)
◆ dbgio_set_irq_usage()
int dbgio_set_irq_usage |
( |
int | mode | ) |
|
Set IRQ usage.
The dbgio system defaults to polled usage. Some devices may not support IRQ mode at all.
- Parameters
-
- Return values
-
0 | On success |
-1 | On error (errno should be set as appropriate) |
◆ dbgio_write()
Write one character to the console.
- Note
- Interfaces may require a call to flush() before the output is actually flushed to the console.
- Parameters
-
- Return values
-
1 | On success (number of characters written) |
-1 | On error (errno should be set as appropriate) |
◆ dbgio_write_buffer()
int dbgio_write_buffer |
( |
const uint8 * | data, |
|
|
int | len ) |
Write an entire buffer of data to the console.
- Parameters
-
data | The buffer to write |
len | The length of the buffer |
- Returns
- Number of characters written on success, or -1 on failure (errno should be set as appropriate)
◆ dbgio_write_buffer_xlat()
int dbgio_write_buffer_xlat |
( |
const uint8 * | data, |
|
|
int | len ) |
Write an entire buffer of data to the console (potentially with newline transformations).
- Parameters
-
data | The buffer to write |
len | The length of the buffer |
- Returns
- Number of characters written on success, or -1 on failure (errno should be set as appropriate)
◆ dbgio_write_str()
int dbgio_write_str |
( |
const char * | str | ) |
|
Write a NUL-terminated string to the console.
- Parameters
-
- Returns
- Number of characters written on success, or -1 on failure (errno should be set as appropriate)
◆ dbglog()
void dbglog |
( |
int | level, |
|
|
const char * | fmt, |
|
|
| ... ) |
Kernel debugging printf.
This function is similar to printf(), but filters its output through a log level check before being printed. This way, you can set the level of debug info you want to see (or want your users to see).
- Parameters
-
level | The level of importance of this message. |
fmt | Message format string. |
... | Format arguments |
- See also
- Log Levels
◆ dbglog_set_level()
void dbglog_set_level |
( |
int | level | ) |
|
Set the debugging log level.
This function sets the level for which dbglog() will ignore messages for if the message has a higher level.
- Parameters
-
level | The level to stop paying attention after. |
- See also
- Log Levels