AVRly - AVR Development Resources
|
Driver file providing logging functionality over USART, to print debug messages and values to a teminal program on your PC. More...
Go to the source code of this file.
Functions | |
void | print_tag_and_log_level (const char *p_tag, log_type_t level) |
Utility function to print labels over serial. More... | |
bool | log_message_preference_check (log_system_config_t *p_config, log_type_t level) |
Utility function to test if the log message level meets the preferences set. More... | |
void | init_log_system (void) |
Initialisation routine - call this function once at startup before using other functions. More... | |
void | log_message (log_system_config_t *p_config, log_type_t level, const char *msg) |
Sends only the system tag, log level and message string. More... | |
void | log_message_with_dec_val (log_system_config_t *p_config, log_type_t level, const char *msg, uint8_t val) |
Sends a string, followed by an 8 bit value in decimal format. More... | |
void | log_message_with_bin_val (log_system_config_t *p_config, log_type_t level, const char *msg, uint8_t val) |
Sends a string, followed by an 8 bit value in binary format. More... | |
void | log_message_with_hex_val (log_system_config_t *p_config, log_type_t level, const char *msg, uint8_t val) |
Sends a string, followed by an 8 bit value in hexadecimal format. More... | |
void | log_set_file_max_output_level (log_system_config_t *p_config, log_type_t level) |
Sets maximum output level of logging required, to be used at file scope. More... | |
void | log_set_global_max_output_level (log_type_t level) |
Sets maximum output level of logging required, has global effect. More... | |
void | log_global_on (void) |
Turns logging system on globally. More... | |
void | log_global_off (void) |
Turns logging system off globally. More... | |
Variables | |
log_system_config_t | log_system_log |
Instantiation of log system config object, pass it's address into logging functions. More... | |
Driver file providing logging functionality over USART, to print debug messages and values to a teminal program on your PC.
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Definition in file log_system.c.
void print_tag_and_log_level | ( | const char * | p_tag, |
log_type_t | level | ||
) |
Utility function to print labels over serial.
Definition at line 260 of file log_system.c.
bool log_message_preference_check | ( | log_system_config_t * | p_config, |
log_type_t | level | ||
) |
Utility function to test if the log message level meets the preferences set.
Definition at line 304 of file log_system.c.
void init_log_system | ( | void | ) |
Initialisation routine - call this function once at startup before using other functions.
Log system will then be turned on by default - call log_global_off() if you do not wish it to be.
Definition at line 76 of file log_system.c.
void log_message | ( | log_system_config_t * | p_config, |
log_type_t | level, | ||
const char * | msg | ||
) |
Sends only the system tag, log level and message string.
p_config | is a pointer to the log_system config object. Instantiate the config object at the head of each file where logging is required and pass it's address into this function. |
level | is the level status of the log message - see log_type_t for available options. |
msg | is the message to be logged, enclose it in "" quotation marks. |
Definition at line 93 of file log_system.c.
void log_message_with_dec_val | ( | log_system_config_t * | p_config, |
log_type_t | level, | ||
const char * | msg, | ||
uint8_t | val | ||
) |
Sends a string, followed by an 8 bit value in decimal format.
p_config | is a pointer to the log_system config object. Instantiate the config object at the head of each file where logging is required and pass it's address into this function. |
level | is the level status of the log message - see log_type_t for available options. |
msg | is the message to be logged, enclose it in "" quotation marks. |
val | is the numerical value to be logged - Acceptable values 0 - 255. |
Definition at line 116 of file log_system.c.
void log_message_with_bin_val | ( | log_system_config_t * | p_config, |
log_type_t | level, | ||
const char * | msg, | ||
uint8_t | val | ||
) |
Sends a string, followed by an 8 bit value in binary format.
p_config | is a pointer to the log_system config object. Instantiate the config object at the head of each file where logging is required and pass it's address into this function. |
level | is the level status of the log message - see log_type_t for available options. |
msg | is the message to be logged, enclose it in "" quotation marks. |
val | is the numerical value to be logged - Acceptable values 0 - 255. |
Definition at line 167 of file log_system.c.
void log_message_with_hex_val | ( | log_system_config_t * | p_config, |
log_type_t | level, | ||
const char * | msg, | ||
uint8_t | val | ||
) |
Sends a string, followed by an 8 bit value in hexadecimal format.
p_config | is a pointer to the log_system config object. Instantiate the config object at the head of each file where logging is required and pass it's address into this function. |
level | is the level status of the log message - see log_type_t for available options. |
msg | is the message to be logged, enclose it in "" quotation marks. |
val | is the numerical value to be logged - Acceptable values 0 - 255. |
Definition at line 193 of file log_system.c.
void log_set_file_max_output_level | ( | log_system_config_t * | p_config, |
log_type_t | level | ||
) |
Sets maximum output level of logging required, to be used at file scope.
p_config | is a pointer to the log_system config object. Instantiate the config object at the head of each file where logging is required and pass it's address into this function. |
level | is the maximum level required - see log_type_t for available options. |
Definition at line 217 of file log_system.c.
void log_set_global_max_output_level | ( | log_type_t | level | ) |
Sets maximum output level of logging required, has global effect.
level | is the maximum level required - see log_type_t for available options. |
Definition at line 229 of file log_system.c.
void log_global_on | ( | void | ) |
Turns logging system on globally.
Definition at line 238 of file log_system.c.
void log_global_off | ( | void | ) |
Turns logging system off globally.
Definition at line 247 of file log_system.c.
log_system_config_t log_system_log |
Instantiation of log system config object, pass it's address into logging functions.
Definition at line 43 of file log_system.c.