2023-01-26 02:53:53 +00:00
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
< html xmlns = "http://www.w3.org/1999/xhtml" >
< head >
< meta http-equiv = "Content-Type" content = "text/xhtml;charset=UTF-8" / >
< meta http-equiv = "X-UA-Compatible" content = "IE=9" / >
< meta name = "generator" content = "Doxygen 1.8.5" / >
2024-04-12 13:21:49 +00:00
< title > MCUXpresso SDK API Reference Manual: Log< / title >
2023-01-26 02:53:53 +00:00
< link href = "tabs.css" rel = "stylesheet" type = "text/css" / >
< script type = "text/javascript" src = "jquery.js" > < / script >
< script type = "text/javascript" src = "dynsections.js" > < / script >
< link href = "navtree.css" rel = "stylesheet" type = "text/css" / >
< script type = "text/javascript" src = "resize.js" > < / script >
< script type = "text/javascript" src = "navtree.js" > < / script >
< script type = "text/javascript" >
$(document).ready(initResizable);
$(window).load(resizeHeight);
< / script >
< link href = "search/search.css" rel = "stylesheet" type = "text/css" / >
< script type = "text/javascript" src = "search/search.js" > < / script >
< script type = "text/javascript" >
$(document).ready(function() { searchBox.OnSelectItem(0); });
< / script >
< link href = "doxygen.css" rel = "stylesheet" type = "text/css" / >
< link href = "customdoxygen.css" rel = "stylesheet" type = "text/css" / >
< / head >
< body >
< div id = "top" > <!-- do not remove this div, it is closed by doxygen! -->
< div id = "titlearea" >
< table cellspacing = "0" cellpadding = "0" >
< tbody >
< tr style = "height: 56px;" >
< td id = "projectlogo" > < img alt = "Logo" src = "fs_logo.gif" / > < / td >
< td style = "padding-left: 0.5em;" >
< div id = "projectname" > MCUXpresso SDK API Reference Manual
2024-04-12 13:21:49 +00:00
  < span id = "projectnumber" > Rev 2.15.000< / span >
2023-01-26 02:53:53 +00:00
< / div >
< div id = "projectbrief" > NXP Semiconductors< / div >
< / td >
< / tr >
< / tbody >
< / table >
< / div >
<!-- end header part -->
<!-- Generated by Doxygen 1.8.5 -->
< script type = "text/javascript" >
var searchBox = new SearchBox("searchBox", "search",false,'Search');
< / script >
< div id = "navrow1" class = "tabs" >
< ul class = "tablist" >
< li > < a href = "index.html" > < span > Main  Page< / span > < / a > < / li >
< li > < a href = "pages.html" > < span > Related  Pages< / span > < / a > < / li >
< li > < a href = "modules.html" > < span > API  Reference< / span > < / a > < / li >
< li >
< div id = "MSearchBox" class = "MSearchBoxInactive" >
< span class = "left" >
< img id = "MSearchSelect" src = "search/mag_sel.png"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
alt=""/>
< input type = "text" id = "MSearchField" value = "Search" accesskey = "S"
onfocus="searchBox.OnSearchFieldFocus(true)"
onblur="searchBox.OnSearchFieldFocus(false)"
onkeyup="searchBox.OnSearchFieldChange(event)"/>
< / span > < span class = "right" >
< a id = "MSearchClose" href = "javascript:searchBox.CloseResultsWindow()" > < img id = "MSearchCloseImg" border = "0" src = "search/close.png" alt = "" / > < / a >
< / span >
< / div >
< / li >
< / ul >
< / div >
< / div > <!-- top -->
< div id = "side-nav" class = "ui-resizable side-nav-resizable" >
< div id = "nav-tree" >
< div id = "nav-tree-contents" >
< div id = "nav-sync" class = "sync" > < / div >
< / div >
< / div >
< div id = "splitbar" style = "-moz-user-select:none;"
class="ui-resizable-handle">
< / div >
< / div >
< script type = "text/javascript" >
$(document).ready(function(){initNavTree('a00068.html','');});
< / script >
< div id = "doc-content" >
<!-- window showing the filter options -->
< div id = "MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
< a class = "SelectItem" href = "javascript:void(0)" onclick = "searchBox.OnSelectItem(0)" > < span class = "SelectionMark" >   < / span > All< / a > < a class = "SelectItem" href = "javascript:void(0)" onclick = "searchBox.OnSelectItem(1)" > < span class = "SelectionMark" >   < / span > Data Structures< / a > < a class = "SelectItem" href = "javascript:void(0)" onclick = "searchBox.OnSelectItem(2)" > < span class = "SelectionMark" >   < / span > Functions< / a > < a class = "SelectItem" href = "javascript:void(0)" onclick = "searchBox.OnSelectItem(3)" > < span class = "SelectionMark" >   < / span > Variables< / a > < a class = "SelectItem" href = "javascript:void(0)" onclick = "searchBox.OnSelectItem(4)" > < span class = "SelectionMark" >   < / span > Typedefs< / a > < a class = "SelectItem" href = "javascript:void(0)" onclick = "searchBox.OnSelectItem(5)" > < span class = "SelectionMark" >   < / span > Enumerations< / a > < a class = "SelectItem" href = "javascript:void(0)" onclick = "searchBox.OnSelectItem(6)" > < span class = "SelectionMark" >   < / span > Enumerator< / a > < a class = "SelectItem" href = "javascript:void(0)" onclick = "searchBox.OnSelectItem(7)" > < span class = "SelectionMark" >   < / span > Groups< / a > < a class = "SelectItem" href = "javascript:void(0)" onclick = "searchBox.OnSelectItem(8)" > < span class = "SelectionMark" >   < / span > Pages< / a > < / div >
<!-- iframe showing the search results (closed by default) -->
< div id = "MSearchResultsWindow" >
< iframe src = "javascript:void(0)" frameborder = "0"
name="MSearchResults" id="MSearchResults">
< / iframe >
< / div >
< div class = "header" >
< div class = "summary" >
2024-04-12 13:21:49 +00:00
< a href = "#groups" > Modules< / a > |
2023-01-26 02:53:53 +00:00
< a href = "#nested-classes" > Data Structures< / a > |
< a href = "#define-members" > Macros< / a > |
< a href = "#typedef-members" > Typedefs< / a > |
< a href = "#enum-members" > Enumerations< / a > |
< a href = "#func-members" > Functions< / a > < / div >
< div class = "headertitle" >
2024-04-12 13:21:49 +00:00
< div class = "title" > Log< / div > < / div >
2023-01-26 02:53:53 +00:00
< / div > <!-- header -->
< div class = "contents" >
< a name = "details" id = "details" > < / a > < h2 class = "groupheader" > Overview< / h2 >
2024-04-12 13:21:49 +00:00
< p > This chapter describes the programming interface of the log component. There are three steps should be followed to use the log component in specfic module,< / p >
< p > step 1, define the macro LOG_ENABLE, likes as, < / p >
< div class = "fragment" > < div class = "line" > < span class = "preprocessor" > #define LOG_ENABLE 1< / span > < / div >
< / div > <!-- fragment --> < dl class = "section note" > < dt > Note< / dt > < dd > LOG_ENABLE could be re-defined as a MODULE enabled flag such as, < div class = "fragment" > < div class = "line" > < span class = "preprocessor" > #define LOG_ENABLE module_LOG_ENABLED_FLAG< / span > < / div >
< / div > <!-- fragment --> < / dd > < / dl >
< p > step 2, include the log component header file, likes as, < / p >
< div class = "fragment" > < div class = "line" > < span class = "preprocessor" > #include " fsl_component_log.h" < / span > < / div >
< / div > <!-- fragment --> < p > step 3, define the log module by using macro LOG_MODULE_DEFINE, likes as, < / p >
< div class = "fragment" > < div class = "line" > LOG_MODULE_DEFINE(< module name> , < module log level> );< / div >
< / div > <!-- fragment --> < dl class = "section note" > < dt > Note< / dt > < dd > The code block should be placed at the end of the header file including of the source code.< / dd > < / dl >
< p > For example, In source file 1, < / p >
< div class = "fragment" > < div class = "line" > < span class = "preprocessor" > #define LOG_ENABLE MODULE1_CONFIG_LOG_ENABLE< / span > < / div >
< div class = "line" > < span class = "preprocessor" > < / span > < span class = "preprocessor" > #include " fsl_component_log.h" < / span > < / div >
< div class = "line" > LOG_MODULE_DEFINE(module1, < a class = "code" href = "a00068.html#ggac91d55174d383848b976a34de843748ea7348c3a3fd6cc9c61eba36a59a916cd8" > kLOG_LevelTrace< / a > );< / div >
< / div > <!-- fragment --> < p > In source file 2, < / p >
< div class = "fragment" > < div class = "line" > < span class = "preprocessor" > #define LOG_ENABLE MODULE2_CONFIG_LOG_ENABLE< / span > < / div >
< div class = "line" > < span class = "preprocessor" > < / span > < span class = "preprocessor" > #include " fsl_component_log.h" < / span > < / div >
< div class = "line" > LOG_MODULE_DEFINE(module2, < a class = "code" href = "a00068.html#ggac91d55174d383848b976a34de843748eac2133b30465d8ce84fa3e8cb39b3e2bb" > kLOG_LevelDebug< / a > );< / div >
< / div > <!-- fragment --> < table class = "memberdecls" >
< tr class = "heading" > < td colspan = "2" > < h2 class = "groupheader" > < a name = "groups" > < / a >
Modules< / h2 > < / td > < / tr >
< tr class = "memitem:a00291" > < td class = "memItemLeft" align = "right" valign = "top" >   < / td > < td class = "memItemRight" valign = "bottom" > < a class = "el" href = "a00291.html" > Log backend debug console< / a > < / td > < / tr >
< tr class = "separator:" > < td class = "memSeparator" colspan = "2" >   < / td > < / tr >
< tr class = "memitem:a00069" > < td class = "memItemLeft" align = "right" valign = "top" >   < / td > < td class = "memItemRight" valign = "bottom" > < a class = "el" href = "a00069.html" > Log backend ring buffer< / a > < / td > < / tr >
< tr class = "separator:" > < td class = "memSeparator" colspan = "2" >   < / td > < / tr >
< tr class = "memitem:a00290" > < td class = "memItemLeft" align = "right" valign = "top" >   < / td > < td class = "memItemRight" valign = "bottom" > < a class = "el" href = "a00290.html" > Log configuration< / a > < / td > < / tr >
< tr class = "separator:" > < td class = "memSeparator" colspan = "2" >   < / td > < / tr >
< / table > < table class = "memberdecls" >
2023-01-26 02:53:53 +00:00
< tr class = "heading" > < td colspan = "2" > < h2 class = "groupheader" > < a name = "nested-classes" > < / a >
Data Structures< / h2 > < / td > < / tr >
2024-04-12 13:21:49 +00:00
< tr class = "memitem:a00452" > < td class = "memItemLeft" align = "right" valign = "top" > struct   < / td > < td class = "memItemRight" valign = "bottom" > < a class = "el" href = "a00068.html#a00452" > log_module< / a > < / td > < / tr >
< tr class = "memdesc:a00452" > < td class = "mdescLeft" >   < / td > < td class = "mdescRight" > log module type < a href = "a00068.html#a00452" > More...< / a > < br / > < / td > < / tr >
< tr class = "separator:a00452" > < td class = "memSeparator" colspan = "2" >   < / td > < / tr >
< tr class = "memitem:a00450" > < td class = "memItemLeft" align = "right" valign = "top" > struct   < / td > < td class = "memItemRight" valign = "bottom" > < a class = "el" href = "a00068.html#a00450" > log_backend< / a > < / td > < / tr >
< tr class = "memdesc:a00450" > < td class = "mdescLeft" >   < / td > < td class = "mdescRight" > Backend of log. < a href = "a00068.html#a00450" > More...< / a > < br / > < / td > < / tr >
< tr class = "separator:a00450" > < td class = "memSeparator" colspan = "2" >   < / td > < / tr >
2023-01-26 02:53:53 +00:00
< / table > < table class = "memberdecls" >
< tr class = "heading" > < td colspan = "2" > < h2 class = "groupheader" > < a name = "define-members" > < / a >
Macros< / h2 > < / td > < / tr >
2024-04-12 13:21:49 +00:00
< tr class = "memitem:ga6f6e0a7a87048fb100a02f5c9d8660d6" > < td class = "memItemLeft" align = "right" valign = "top" > #define  < / td > < td class = "memItemRight" valign = "bottom" > < a class = "el" href = "a00068.html#ga6f6e0a7a87048fb100a02f5c9d8660d6" > LOG_FILE_NAME< / a >       LOG_FILE_NAME_SET(LOG_FILE_NAME_RECURSIVE, LOG_FILE_NAME_INTERCEPT, __FILE__, 3) : __FILE__< / td > < / tr >
< tr class = "memdesc:ga6f6e0a7a87048fb100a02f5c9d8660d6" > < td class = "mdescLeft" >   < / td > < td class = "mdescRight" > Source file name definition. < a href = "#ga6f6e0a7a87048fb100a02f5c9d8660d6" > More...< / a > < br / > < / td > < / tr >
< tr class = "separator:ga6f6e0a7a87048fb100a02f5c9d8660d6" > < td class = "memSeparator" colspan = "2" >   < / td > < / tr >
< tr class = "memitem:ga3e611377ee5b2dcd95f310caa2803264" > < td class = "memItemLeft" align = "right" valign = "top" > #define  < / td > < td class = "memItemRight" valign = "bottom" > < a class = "el" href = "a00068.html#ga3e611377ee5b2dcd95f310caa2803264" > LOG_BACKEND_DEFINE< / a > (name, puts)      static < a class = "el" href = "a00068.html#ga5a08b81f153f5a62184005edf7f202e6" > log_backend_t< / a > name = {NULL, puts}< / td > < / tr >
< tr class = "memdesc:ga3e611377ee5b2dcd95f310caa2803264" > < td class = "mdescLeft" >   < / td > < td class = "mdescRight" > Defines the log backend. < a href = "#ga3e611377ee5b2dcd95f310caa2803264" > More...< / a > < br / > < / td > < / tr >
< tr class = "separator:ga3e611377ee5b2dcd95f310caa2803264" > < td class = "memSeparator" colspan = "2" >   < / td > < / tr >
2023-01-26 02:53:53 +00:00
< / table > < table class = "memberdecls" >
< tr class = "heading" > < td colspan = "2" > < h2 class = "groupheader" > < a name = "typedef-members" > < / a >
Typedefs< / h2 > < / td > < / tr >
2024-04-12 13:21:49 +00:00
< tr class = "memitem:gabfb4df30a98000a8d940731b9cd91873" > < td class = "memItemLeft" align = "right" valign = "top" > < a class = "anchor" id = "gabfb4df30a98000a8d940731b9cd91873" > < / a >
typedef enum < a class = "el" href = "a00068.html#ga90d570104b5448c550bf04696a1cdda8" > _log_status< / a >   < / td > < td class = "memItemRight" valign = "bottom" > < a class = "el" href = "a00068.html#gabfb4df30a98000a8d940731b9cd91873" > log_status_t< / a > < / td > < / tr >
< tr class = "memdesc:gabfb4df30a98000a8d940731b9cd91873" > < td class = "mdescLeft" >   < / td > < td class = "mdescRight" > log error code < br / > < / td > < / tr >
< tr class = "separator:gabfb4df30a98000a8d940731b9cd91873" > < td class = "memSeparator" colspan = "2" >   < / td > < / tr >
< tr class = "memitem:gae8208ffb3f6679921c91411a9737e4f1" > < td class = "memItemLeft" align = "right" valign = "top" > typedef enum < a class = "el" href = "a00068.html#gac91d55174d383848b976a34de843748e" > log_level< / a >   < / td > < td class = "memItemRight" valign = "bottom" > < a class = "el" href = "a00068.html#gae8208ffb3f6679921c91411a9737e4f1" > log_level_t< / a > < / td > < / tr >
< tr class = "memdesc:gae8208ffb3f6679921c91411a9737e4f1" > < td class = "mdescLeft" >   < / td > < td class = "mdescRight" > log level definition < a href = "#gae8208ffb3f6679921c91411a9737e4f1" > More...< / a > < br / > < / td > < / tr >
< tr class = "separator:gae8208ffb3f6679921c91411a9737e4f1" > < td class = "memSeparator" colspan = "2" >   < / td > < / tr >
< tr class = "memitem:ga083114bb3e7644aa7c6546b1bbb3a244" > < td class = "memItemLeft" align = "right" valign = "top" > < a class = "anchor" id = "ga083114bb3e7644aa7c6546b1bbb3a244" > < / a >
typedef struct < a class = "el" href = "a00068.html#a00452" > log_module< / a >   < / td > < td class = "memItemRight" valign = "bottom" > < a class = "el" href = "a00068.html#ga083114bb3e7644aa7c6546b1bbb3a244" > log_module_t< / a > < / td > < / tr >
< tr class = "memdesc:ga083114bb3e7644aa7c6546b1bbb3a244" > < td class = "mdescLeft" >   < / td > < td class = "mdescRight" > log module type < br / > < / td > < / tr >
< tr class = "separator:ga083114bb3e7644aa7c6546b1bbb3a244" > < td class = "memSeparator" colspan = "2" >   < / td > < / tr >
< tr class = "memitem:ga162181cdb50efa6e3cd748fbbc48616e" > < td class = "memItemLeft" align = "right" valign = "top" > < a class = "anchor" id = "ga162181cdb50efa6e3cd748fbbc48616e" > < / a >
typedef void(*  < / td > < td class = "memItemRight" valign = "bottom" > < a class = "el" href = "a00068.html#ga162181cdb50efa6e3cd748fbbc48616e" > log_backend_puts_t< / a > )(uint8_t *buffer, size_t length)< / td > < / tr >
< tr class = "memdesc:ga162181cdb50efa6e3cd748fbbc48616e" > < td class = "mdescLeft" >   < / td > < td class = "mdescRight" > Puts function type for log backend. < br / > < / td > < / tr >
< tr class = "separator:ga162181cdb50efa6e3cd748fbbc48616e" > < td class = "memSeparator" colspan = "2" >   < / td > < / tr >
< tr class = "memitem:gacaa6790fdcff97379c8235b9b9177f8b" > < td class = "memItemLeft" align = "right" valign = "top" > < a class = "anchor" id = "gacaa6790fdcff97379c8235b9b9177f8b" > < / a >
typedef < a class = "el" href = "a00068.html#gabfb4df30a98000a8d940731b9cd91873" > log_status_t< / a > (*  < / td > < td class = "memItemRight" valign = "bottom" > < a class = "el" href = "a00068.html#gacaa6790fdcff97379c8235b9b9177f8b" > log_backend_get_dump_buffer_t< / a > )(uint8_t **buffer, size_t *length)< / td > < / tr >
< tr class = "memdesc:gacaa6790fdcff97379c8235b9b9177f8b" > < td class = "mdescLeft" >   < / td > < td class = "mdescRight" > Gets dump buffer from log backend. < br / > < / td > < / tr >
< tr class = "separator:gacaa6790fdcff97379c8235b9b9177f8b" > < td class = "memSeparator" colspan = "2" >   < / td > < / tr >
< tr class = "memitem:ga5a08b81f153f5a62184005edf7f202e6" > < td class = "memItemLeft" align = "right" valign = "top" > typedef struct < a class = "el" href = "a00068.html#a00450" > log_backend< / a >   < / td > < td class = "memItemRight" valign = "bottom" > < a class = "el" href = "a00068.html#ga5a08b81f153f5a62184005edf7f202e6" > log_backend_t< / a > < / td > < / tr >
< tr class = "memdesc:ga5a08b81f153f5a62184005edf7f202e6" > < td class = "mdescLeft" >   < / td > < td class = "mdescRight" > Backend of log. < a href = "#ga5a08b81f153f5a62184005edf7f202e6" > More...< / a > < br / > < / td > < / tr >
< tr class = "separator:ga5a08b81f153f5a62184005edf7f202e6" > < td class = "memSeparator" colspan = "2" >   < / td > < / tr >
< tr class = "memitem:ga5535c6738db402373c016fdc940b53e1" > < td class = "memItemLeft" align = "right" valign = "top" > < a class = "anchor" id = "ga5535c6738db402373c016fdc940b53e1" > < / a >
typedef unsigned int(*  < / td > < td class = "memItemRight" valign = "bottom" > < a class = "el" href = "a00068.html#ga5535c6738db402373c016fdc940b53e1" > log_get_timestamp_callback_t< / a > )(void)< / td > < / tr >
< tr class = "memdesc:ga5535c6738db402373c016fdc940b53e1" > < td class = "mdescLeft" >   < / td > < td class = "mdescRight" > get time stamp function < br / > < / td > < / tr >
< tr class = "separator:ga5535c6738db402373c016fdc940b53e1" > < td class = "memSeparator" colspan = "2" >   < / td > < / tr >
2023-01-26 02:53:53 +00:00
< / table > < table class = "memberdecls" >
< tr class = "heading" > < td colspan = "2" > < h2 class = "groupheader" > < a name = "enum-members" > < / a >
Enumerations< / h2 > < / td > < / tr >
2024-04-12 13:21:49 +00:00
< tr class = "memitem:ga90d570104b5448c550bf04696a1cdda8" > < td class = "memItemLeft" align = "right" valign = "top" > enum   < / td > < td class = "memItemRight" valign = "bottom" > < a class = "el" href = "a00068.html#ga90d570104b5448c550bf04696a1cdda8" > _log_status< / a > { < br / >
    < a class = "el" href = "a00068.html#gga90d570104b5448c550bf04696a1cdda8a146431906d5a44b334cc8e699161dd2e" > kStatus_LOG_Success< / a > = kStatus_Success,
2023-01-26 02:53:53 +00:00
< br / >
2024-04-12 13:21:49 +00:00
    < a class = "el" href = "a00068.html#gga90d570104b5448c550bf04696a1cdda8ab4f38ad1a659a748a8048de5f42977e4" > kStatus_LOG_Error< / a > = MAKE_STATUS(kStatusGroup_LOG, 1),
2023-01-26 02:53:53 +00:00
< br / >
2024-04-12 13:21:49 +00:00
    < a class = "el" href = "a00068.html#gga90d570104b5448c550bf04696a1cdda8a6cb0d4034e3604528c8ae9d01b4ebd70" > kStatus_LOG_Initialized< / a > = MAKE_STATUS(kStatusGroup_LOG, 2),
2023-01-26 02:53:53 +00:00
< br / >
2024-04-12 13:21:49 +00:00
    < a class = "el" href = "a00068.html#gga90d570104b5448c550bf04696a1cdda8addbd9d6389dbfb9ca64821886a076c32" > kStatus_LOG_Uninitialized< / a > = MAKE_STATUS(kStatusGroup_LOG, 3),
2023-01-26 02:53:53 +00:00
< br / >
2024-04-12 13:21:49 +00:00
    < a class = "el" href = "a00068.html#gga90d570104b5448c550bf04696a1cdda8a7bf640129089c975d2c3d03e851947a9" > kStatus_LOG_LackResource< / a > = MAKE_STATUS(kStatusGroup_LOG, 4),
2023-01-26 02:53:53 +00:00
< br / >
2024-04-12 13:21:49 +00:00
    < a class = "el" href = "a00068.html#gga90d570104b5448c550bf04696a1cdda8a708743966b0312759fe8efd43996e3e7" > kStatus_LOG_BackendExist< / a > = MAKE_STATUS(kStatusGroup_LOG, 5),
2023-01-26 02:53:53 +00:00
< br / >
2024-04-12 13:21:49 +00:00
    < a class = "el" href = "a00068.html#gga90d570104b5448c550bf04696a1cdda8aa9407c037f8443cdb65f085d7a75b3a6" > kStatus_LOG_BackendNotFound< / a > = MAKE_STATUS(kStatusGroup_LOG, 6)
2023-01-26 02:53:53 +00:00
< br / >
}< / td > < / tr >
2024-04-12 13:21:49 +00:00
< tr class = "memdesc:ga90d570104b5448c550bf04696a1cdda8" > < td class = "mdescLeft" >   < / td > < td class = "mdescRight" > log error code < a href = "a00068.html#ga90d570104b5448c550bf04696a1cdda8" > More...< / a > < br / > < / td > < / tr >
< tr class = "separator:ga90d570104b5448c550bf04696a1cdda8" > < td class = "memSeparator" colspan = "2" >   < / td > < / tr >
< tr class = "memitem:gac91d55174d383848b976a34de843748e" > < td class = "memItemLeft" align = "right" valign = "top" > enum   < / td > < td class = "memItemRight" valign = "bottom" > < a class = "el" href = "a00068.html#gac91d55174d383848b976a34de843748e" > log_level< / a > { < br / >
    < a class = "el" href = "a00068.html#ggac91d55174d383848b976a34de843748ea77e6f7c439bb3a12e07fa7c1af1d84e8" > kLOG_LevelNone< / a > = 0,
2023-01-26 02:53:53 +00:00
< br / >
2024-04-12 13:21:49 +00:00
    < a class = "el" href = "a00068.html#ggac91d55174d383848b976a34de843748ea7fd23432e4ccbdccb2cb83a4a6944d85" > kLOG_LevelFatal< / a > ,
2023-01-26 02:53:53 +00:00
< br / >
2024-04-12 13:21:49 +00:00
    < a class = "el" href = "a00068.html#ggac91d55174d383848b976a34de843748ea42717349ce3bb26bd225a76caecb6dee" > kLOG_LevelError< / a > ,
2023-01-26 02:53:53 +00:00
< br / >
2024-04-12 13:21:49 +00:00
    < a class = "el" href = "a00068.html#ggac91d55174d383848b976a34de843748ea4deeb3bbd94e3d5588961ede4527f0fe" > kLOG_LevelWarning< / a > ,
2023-01-26 02:53:53 +00:00
< br / >
2024-04-12 13:21:49 +00:00
    < a class = "el" href = "a00068.html#ggac91d55174d383848b976a34de843748ea1f9fb8c886f50c93acdeb95673a1066a" > kLOG_LevelInfo< / a > ,
2023-01-26 02:53:53 +00:00
< br / >
2024-04-12 13:21:49 +00:00
    < a class = "el" href = "a00068.html#ggac91d55174d383848b976a34de843748eac2133b30465d8ce84fa3e8cb39b3e2bb" > kLOG_LevelDebug< / a > ,
2023-01-26 02:53:53 +00:00
< br / >
2024-04-12 13:21:49 +00:00
    < a class = "el" href = "a00068.html#ggac91d55174d383848b976a34de843748ea7348c3a3fd6cc9c61eba36a59a916cd8" > kLOG_LevelTrace< / a >
2023-01-26 02:53:53 +00:00
< br / >
}< / td > < / tr >
2024-04-12 13:21:49 +00:00
< tr class = "memdesc:gac91d55174d383848b976a34de843748e" > < td class = "mdescLeft" >   < / td > < td class = "mdescRight" > log level definition < a href = "a00068.html#gac91d55174d383848b976a34de843748e" > More...< / a > < br / > < / td > < / tr >
< tr class = "separator:gac91d55174d383848b976a34de843748e" > < td class = "memSeparator" colspan = "2" >   < / td > < / tr >
2023-01-26 02:53:53 +00:00
< / table > < table class = "memberdecls" >
< tr class = "heading" > < td colspan = "2" > < h2 class = "groupheader" > < a name = "func-members" > < / a >
Functions< / h2 > < / td > < / tr >
2024-04-12 13:21:49 +00:00
< tr class = "memitem:ga8aa794955cb34997a4cfacca93bed663" > < td class = "memItemLeft" align = "right" valign = "top" > < a class = "el" href = "a00068.html#gabfb4df30a98000a8d940731b9cd91873" > log_status_t< / a >   < / td > < td class = "memItemRight" valign = "bottom" > < a class = "el" href = "a00068.html#ga8aa794955cb34997a4cfacca93bed663" > LOG_Init< / a > (void)< / td > < / tr >
< tr class = "memdesc:ga8aa794955cb34997a4cfacca93bed663" > < td class = "mdescLeft" >   < / td > < td class = "mdescRight" > Initializes the log component with the user configuration structure. < a href = "#ga8aa794955cb34997a4cfacca93bed663" > More...< / a > < br / > < / td > < / tr >
< tr class = "separator:ga8aa794955cb34997a4cfacca93bed663" > < td class = "memSeparator" colspan = "2" >   < / td > < / tr >
< tr class = "memitem:ga4a93abd060d96149634c3b5c1170c798" > < td class = "memItemLeft" align = "right" valign = "top" > < a class = "el" href = "a00068.html#gabfb4df30a98000a8d940731b9cd91873" > log_status_t< / a >   < / td > < td class = "memItemRight" valign = "bottom" > < a class = "el" href = "a00068.html#ga4a93abd060d96149634c3b5c1170c798" > LOG_Deinit< / a > (void)< / td > < / tr >
< tr class = "memdesc:ga4a93abd060d96149634c3b5c1170c798" > < td class = "mdescLeft" >   < / td > < td class = "mdescRight" > De-initializes the log component. < a href = "#ga4a93abd060d96149634c3b5c1170c798" > More...< / a > < br / > < / td > < / tr >
< tr class = "separator:ga4a93abd060d96149634c3b5c1170c798" > < td class = "memSeparator" colspan = "2" >   < / td > < / tr >
< tr class = "memitem:ga3a12e6fa68c08fc6cba9a95554c70585" > < td class = "memItemLeft" align = "right" valign = "top" > void  < / td > < td class = "memItemRight" valign = "bottom" > < a class = "el" href = "a00068.html#ga3a12e6fa68c08fc6cba9a95554c70585" > LOG_Printf< / a > (< a class = "el" href = "a00068.html#ga083114bb3e7644aa7c6546b1bbb3a244" > log_module_t< / a > const *module, < a class = "el" href = "a00068.html#gae8208ffb3f6679921c91411a9737e4f1" > log_level_t< / a > level, unsigned int timeStamp, char const *format,...)< / td > < / tr >
< tr class = "memdesc:ga3a12e6fa68c08fc6cba9a95554c70585" > < td class = "mdescLeft" >   < / td > < td class = "mdescRight" > Prints the format log string. < a href = "#ga3a12e6fa68c08fc6cba9a95554c70585" > More...< / a > < br / > < / td > < / tr >
< tr class = "separator:ga3a12e6fa68c08fc6cba9a95554c70585" > < td class = "memSeparator" colspan = "2" >   < / td > < / tr >
< tr class = "memitem:ga41f2cb6b31db1d366b8be2b0bec0c78d" > < td class = "memItemLeft" align = "right" valign = "top" > < a class = "el" href = "a00068.html#gabfb4df30a98000a8d940731b9cd91873" > log_status_t< / a >   < / td > < td class = "memItemRight" valign = "bottom" > < a class = "el" href = "a00068.html#ga41f2cb6b31db1d366b8be2b0bec0c78d" > LOG_BackendRegister< / a > (< a class = "el" href = "a00068.html#ga5a08b81f153f5a62184005edf7f202e6" > log_backend_t< / a > *backend)< / td > < / tr >
< tr class = "memdesc:ga41f2cb6b31db1d366b8be2b0bec0c78d" > < td class = "mdescLeft" >   < / td > < td class = "mdescRight" > Registers backend. < a href = "#ga41f2cb6b31db1d366b8be2b0bec0c78d" > More...< / a > < br / > < / td > < / tr >
< tr class = "separator:ga41f2cb6b31db1d366b8be2b0bec0c78d" > < td class = "memSeparator" colspan = "2" >   < / td > < / tr >
< tr class = "memitem:gabf34b1a764160401a59f183e7047b171" > < td class = "memItemLeft" align = "right" valign = "top" > < a class = "el" href = "a00068.html#gabfb4df30a98000a8d940731b9cd91873" > log_status_t< / a >   < / td > < td class = "memItemRight" valign = "bottom" > < a class = "el" href = "a00068.html#gabf34b1a764160401a59f183e7047b171" > LOG_BackendUnregister< / a > (< a class = "el" href = "a00068.html#ga5a08b81f153f5a62184005edf7f202e6" > log_backend_t< / a > *backend)< / td > < / tr >
< tr class = "memdesc:gabf34b1a764160401a59f183e7047b171" > < td class = "mdescLeft" >   < / td > < td class = "mdescRight" > Unregisters backend. < a href = "#gabf34b1a764160401a59f183e7047b171" > More...< / a > < br / > < / td > < / tr >
< tr class = "separator:gabf34b1a764160401a59f183e7047b171" > < td class = "memSeparator" colspan = "2" >   < / td > < / tr >
< tr class = "memitem:gab6b65462157ea929728bc31f068d06d9" > < td class = "memItemLeft" align = "right" valign = "top" > < a class = "el" href = "a00068.html#gabfb4df30a98000a8d940731b9cd91873" > log_status_t< / a >   < / td > < td class = "memItemRight" valign = "bottom" > < a class = "el" href = "a00068.html#gab6b65462157ea929728bc31f068d06d9" > LOG_SetTimestamp< / a > (< a class = "el" href = "a00068.html#ga5535c6738db402373c016fdc940b53e1" > log_get_timestamp_callback_t< / a > getTimeStamp)< / td > < / tr >
< tr class = "memdesc:gab6b65462157ea929728bc31f068d06d9" > < td class = "mdescLeft" >   < / td > < td class = "mdescRight" > Sets the get timestamp function callback. < a href = "#gab6b65462157ea929728bc31f068d06d9" > More...< / a > < br / > < / td > < / tr >
< tr class = "separator:gab6b65462157ea929728bc31f068d06d9" > < td class = "memSeparator" colspan = "2" >   < / td > < / tr >
< tr class = "memitem:gad8962b569a5874f7618eeca3cad589a6" > < td class = "memItemLeft" align = "right" valign = "top" > unsigned int  < / td > < td class = "memItemRight" valign = "bottom" > < a class = "el" href = "a00068.html#gad8962b569a5874f7618eeca3cad589a6" > LOG_GetTimestamp< / a > (void)< / td > < / tr >
< tr class = "memdesc:gad8962b569a5874f7618eeca3cad589a6" > < td class = "mdescLeft" >   < / td > < td class = "mdescRight" > Gets current timestamp. < a href = "#gad8962b569a5874f7618eeca3cad589a6" > More...< / a > < br / > < / td > < / tr >
< tr class = "separator:gad8962b569a5874f7618eeca3cad589a6" > < td class = "memSeparator" colspan = "2" >   < / td > < / tr >
2023-01-26 02:53:53 +00:00
< / table >
< hr / > < h2 class = "groupheader" > Data Structure Documentation< / h2 >
2024-04-12 13:21:49 +00:00
< a name = "a00452" id = "a00452" > < / a >
2023-01-26 02:53:53 +00:00
< div class = "memitem" >
< div class = "memproto" >
< table class = "memname" >
< tr >
2024-04-12 13:21:49 +00:00
< td class = "memname" > struct log_module< / td >
2023-01-26 02:53:53 +00:00
< / tr >
2024-04-12 13:21:49 +00:00
< / table >
< / div > < div class = "memdoc" >
< div class = "textblock" > < / div > < table class = "memberdecls" >
< tr > < td colspan = "2" > < h3 > Data Fields< / h3 > < / td > < / tr >
< tr class = "memitem:aa93b4907d47c5cddfd6eb8197a793477" > < td class = "memItemLeft" align = "right" valign = "top" > < a class = "anchor" id = "aa93b4907d47c5cddfd6eb8197a793477" > < / a >
const char *  < / td > < td class = "memItemRight" valign = "bottom" > < a class = "el" href = "a00068.html#aa93b4907d47c5cddfd6eb8197a793477" > logModuleName< / a > < / td > < / tr >
< tr class = "memdesc:aa93b4907d47c5cddfd6eb8197a793477" > < td class = "mdescLeft" >   < / td > < td class = "mdescRight" > Log module name. < br / > < / td > < / tr >
< tr class = "separator:aa93b4907d47c5cddfd6eb8197a793477" > < td class = "memSeparator" colspan = "2" >   < / td > < / tr >
< tr class = "memitem:accd17f6a5c900595eab590c0bfb29e7d" > < td class = "memItemLeft" align = "right" valign = "top" > < a class = "anchor" id = "accd17f6a5c900595eab590c0bfb29e7d" > < / a >
< a class = "el" href = "a00068.html#gae8208ffb3f6679921c91411a9737e4f1" > log_level_t< / a >   < / td > < td class = "memItemRight" valign = "bottom" > < a class = "el" href = "a00068.html#accd17f6a5c900595eab590c0bfb29e7d" > level< / a > < / td > < / tr >
< tr class = "memdesc:accd17f6a5c900595eab590c0bfb29e7d" > < td class = "mdescLeft" >   < / td > < td class = "mdescRight" > Log level of the module. < br / > < / td > < / tr >
< tr class = "separator:accd17f6a5c900595eab590c0bfb29e7d" > < td class = "memSeparator" colspan = "2" >   < / td > < / tr >
< / table >
2023-01-26 02:53:53 +00:00
< / div >
< / div >
2024-04-12 13:21:49 +00:00
< a name = "a00450" id = "a00450" > < / a >
2023-01-26 02:53:53 +00:00
< div class = "memitem" >
< div class = "memproto" >
< table class = "memname" >
< tr >
2024-04-12 13:21:49 +00:00
< td class = "memname" > struct log_backend< / td >
2023-01-26 02:53:53 +00:00
< / tr >
< / table >
< / div > < div class = "memdoc" >
2024-04-12 13:21:49 +00:00
< div class = "textblock" > < / div > < table class = "memberdecls" >
< tr > < td colspan = "2" > < h3 > Data Fields< / h3 > < / td > < / tr >
< tr class = "memitem:a5d913a3bb118b637885f13e390471f34" > < td class = "memItemLeft" align = "right" valign = "top" > < a class = "anchor" id = "a5d913a3bb118b637885f13e390471f34" > < / a >
struct < a class = "el" href = "a00068.html#a00450" > log_backend< / a > *  < / td > < td class = "memItemRight" valign = "bottom" > < a class = "el" href = "a00068.html#a5d913a3bb118b637885f13e390471f34" > next< / a > < / td > < / tr >
< tr class = "memdesc:a5d913a3bb118b637885f13e390471f34" > < td class = "mdescLeft" >   < / td > < td class = "mdescRight" > Next log backend pointer. < br / > < / td > < / tr >
< tr class = "separator:a5d913a3bb118b637885f13e390471f34" > < td class = "memSeparator" colspan = "2" >   < / td > < / tr >
< tr class = "memitem:ab8cac6d7c7a70f82bfe3ece79e98d4a5" > < td class = "memItemLeft" align = "right" valign = "top" > < a class = "anchor" id = "ab8cac6d7c7a70f82bfe3ece79e98d4a5" > < / a >
< a class = "el" href = "a00068.html#ga162181cdb50efa6e3cd748fbbc48616e" > log_backend_puts_t< / a >   < / td > < td class = "memItemRight" valign = "bottom" > < a class = "el" href = "a00068.html#ab8cac6d7c7a70f82bfe3ece79e98d4a5" > putStr< / a > < / td > < / tr >
< tr class = "memdesc:ab8cac6d7c7a70f82bfe3ece79e98d4a5" > < td class = "mdescLeft" >   < / td > < td class = "mdescRight" > Put data function of log backend. < br / > < / td > < / tr >
< tr class = "separator:ab8cac6d7c7a70f82bfe3ece79e98d4a5" > < td class = "memSeparator" colspan = "2" >   < / td > < / tr >
< / table >
2023-01-26 02:53:53 +00:00
< / div >
< / div >
2024-04-12 13:21:49 +00:00
< h2 class = "groupheader" > Macro Definition Documentation< / h2 >
< a class = "anchor" id = "ga6f6e0a7a87048fb100a02f5c9d8660d6" > < / a >
2023-01-26 02:53:53 +00:00
< div class = "memitem" >
< div class = "memproto" >
< table class = "memname" >
< tr >
2024-04-12 13:21:49 +00:00
< td class = "memname" > #define LOG_FILE_NAME      LOG_FILE_NAME_SET(LOG_FILE_NAME_RECURSIVE, LOG_FILE_NAME_INTERCEPT, __FILE__, 3) : __FILE__< / td >
2023-01-26 02:53:53 +00:00
< / tr >
< / table >
< / div > < div class = "memdoc" >
2024-04-12 13:21:49 +00:00
< p > There is a macro __BASE_FILE__ could be used to get the current source file name in GCC. While the macro is unsupported by IAR in default, the __BASE_FILE__ is same as __FILE__ in IAR. To support the macro __BASE_FILE__, the extra option – no_path_in_file_macros should be added for IAR. But on Keil, only the source file name cannot be got through the macro __BASE_FILE__.< / p >
< p > So, log component adds a macro LOG_FILE_NAME to get the current source file name during the compilation phase, when config LOG_ENABLE_FILE_WITH_PATH is disabled. There is a limitation, the length of file name should be not less than 2, and the supported MAX length of file name is 66 bytes. Otherwise the original string of __FILE__ will be linked. < / p >
2023-01-26 02:53:53 +00:00
< / div >
< / div >
2024-04-12 13:21:49 +00:00
< a class = "anchor" id = "ga3e611377ee5b2dcd95f310caa2803264" > < / a >
2023-01-26 02:53:53 +00:00
< div class = "memitem" >
< div class = "memproto" >
< table class = "memname" >
< tr >
2024-04-12 13:21:49 +00:00
< td class = "memname" > #define LOG_BACKEND_DEFINE< / td >
2023-01-26 02:53:53 +00:00
< td > (< / td >
2024-04-12 13:21:49 +00:00
< td class = "paramtype" >   < / td >
< td class = "paramname" > name, < / td >
2023-01-26 02:53:53 +00:00
< / tr >
< tr >
< td class = "paramkey" > < / td >
< td > < / td >
2024-04-12 13:21:49 +00:00
< td class = "paramtype" >   < / td >
< td class = "paramname" > puts  < / td >
2023-01-26 02:53:53 +00:00
< / tr >
< tr >
< td > < / td >
< td > )< / td >
2024-04-12 13:21:49 +00:00
< td > < / td > < td >       static < a class = "el" href = "a00068.html#ga5a08b81f153f5a62184005edf7f202e6" > log_backend_t< / a > name = {NULL, puts}< / td >
2023-01-26 02:53:53 +00:00
< / tr >
< / table >
< / div > < div class = "memdoc" >
2024-04-12 13:21:49 +00:00
< p > This macro is used to define the log backend. The static global variable with parameter name is defined by the macro. And calling the function log_backend_register to register the backend with defined static global variable. For example, if there is a backend named test, the reference code is following, < / p >
< div class = "fragment" > < div class = "line" > * < span class = "keyword" > static< / span > < span class = "keywordtype" > void< / span > puts(uint8_t *buffer, < span class = "keywordtype" > size_t< / span > length)< / div >
< div class = "line" > * {< / div >
< div class = "line" > * ...< / div >
< div class = "line" > * }< / div >
< div class = "line" > * < a class = "code" href = "a00068.html#ga3e611377ee5b2dcd95f310caa2803264" > LOG_BACKEND_DEFINE< / a > (test, puts);< / div >
< div class = "line" > * < / div >
< / div > <!-- fragment --> < dl class = "params" > < dt > Parameters< / dt > < dd >
2023-01-26 02:53:53 +00:00
< table class = "params" >
2024-04-12 13:21:49 +00:00
< tr > < td class = "paramname" > name< / td > < td > The name of the log backend. < / td > < / tr >
< tr > < td class = "paramname" > puts< / td > < td > The log string output function with log_backend_puts_t type. < / td > < / tr >
2023-01-26 02:53:53 +00:00
< / table >
< / dd >
< / dl >
< / div >
< / div >
2024-04-12 13:21:49 +00:00
< h2 class = "groupheader" > Typedef Documentation< / h2 >
< a class = "anchor" id = "gae8208ffb3f6679921c91411a9737e4f1" > < / a >
2023-01-26 02:53:53 +00:00
< div class = "memitem" >
< div class = "memproto" >
< table class = "memname" >
< tr >
2024-04-12 13:21:49 +00:00
< td class = "memname" > typedef enum < a class = "el" href = "a00068.html#gac91d55174d383848b976a34de843748e" > log_level< / a > < a class = "el" href = "a00068.html#gae8208ffb3f6679921c91411a9737e4f1" > log_level_t< / a > < / td >
2023-01-26 02:53:53 +00:00
< / tr >
< / table >
< / div > < div class = "memdoc" >
2024-04-12 13:21:49 +00:00
< p > The log level behavior is following,< br / >
If level is kLOG_LevelTrace, trace, debug, info, warning, error, and fatal of log level will be printed.< br / >
If level is kLOG_LevelDebug, debug, info, warning, error, and fatal of log level will be printed.< br / >
If level is kLOG_LevelInfo, info, warning, error, and fatal of log level will be printed.< br / >
If level is kLOG_LevelWarning, warning, error, and fatal of log level will be printed.< br / >
If level is kLOG_LevelError, error, and fatal of log level will be printed.< br / >
If level is kLOG_LevelFatal, only fatal of log level will be printed.< br / >
If level is kLOG_LevelNone, no log level will be printed.< br / >
< / p >
2023-01-26 02:53:53 +00:00
< / div >
< / div >
2024-04-12 13:21:49 +00:00
< a class = "anchor" id = "ga5a08b81f153f5a62184005edf7f202e6" > < / a >
2023-01-26 02:53:53 +00:00
< div class = "memitem" >
< div class = "memproto" >
< table class = "memname" >
< tr >
2024-04-12 13:21:49 +00:00
< td class = "memname" > typedef struct < a class = "el" href = "a00068.html#a00450" > log_backend< / a > < a class = "el" href = "a00068.html#ga5a08b81f153f5a62184005edf7f202e6" > log_backend_t< / a > < / td >
2023-01-26 02:53:53 +00:00
< / tr >
< / table >
< / div > < div class = "memdoc" >
< / div >
< / div >
2024-04-12 13:21:49 +00:00
< h2 class = "groupheader" > Enumeration Type Documentation< / h2 >
< a class = "anchor" id = "ga90d570104b5448c550bf04696a1cdda8" > < / a >
2023-01-26 02:53:53 +00:00
< div class = "memitem" >
< div class = "memproto" >
< table class = "memname" >
< tr >
2024-04-12 13:21:49 +00:00
< td class = "memname" > enum < a class = "el" href = "a00068.html#ga90d570104b5448c550bf04696a1cdda8" > _log_status< / a > < / td >
2023-01-26 02:53:53 +00:00
< / tr >
< / table >
< / div > < div class = "memdoc" >
2024-04-12 13:21:49 +00:00
< table class = "fieldtable" >
< tr > < th colspan = "2" > Enumerator< / th > < / tr > < tr > < td class = "fieldname" > < em > < a class = "anchor" id = "gga90d570104b5448c550bf04696a1cdda8a146431906d5a44b334cc8e699161dd2e" > < / a > kStatus_LOG_Success< / em > < / td > < td class = "fielddoc" >
< p > Success. < / p >
< / td > < / tr >
< tr > < td class = "fieldname" > < em > < a class = "anchor" id = "gga90d570104b5448c550bf04696a1cdda8ab4f38ad1a659a748a8048de5f42977e4" > < / a > kStatus_LOG_Error< / em > < / td > < td class = "fielddoc" >
< p > Failed. < / p >
< / td > < / tr >
< tr > < td class = "fieldname" > < em > < a class = "anchor" id = "gga90d570104b5448c550bf04696a1cdda8a6cb0d4034e3604528c8ae9d01b4ebd70" > < / a > kStatus_LOG_Initialized< / em > < / td > < td class = "fielddoc" >
< p > Initialized. < / p >
< / td > < / tr >
< tr > < td class = "fieldname" > < em > < a class = "anchor" id = "gga90d570104b5448c550bf04696a1cdda8addbd9d6389dbfb9ca64821886a076c32" > < / a > kStatus_LOG_Uninitialized< / em > < / td > < td class = "fielddoc" >
< p > Uninitialized. < / p >
< / td > < / tr >
< tr > < td class = "fieldname" > < em > < a class = "anchor" id = "gga90d570104b5448c550bf04696a1cdda8a7bf640129089c975d2c3d03e851947a9" > < / a > kStatus_LOG_LackResource< / em > < / td > < td class = "fielddoc" >
< p > Lack resource. < / p >
< / td > < / tr >
< tr > < td class = "fieldname" > < em > < a class = "anchor" id = "gga90d570104b5448c550bf04696a1cdda8a708743966b0312759fe8efd43996e3e7" > < / a > kStatus_LOG_BackendExist< / em > < / td > < td class = "fielddoc" >
< p > Backend exists. < / p >
< / td > < / tr >
< tr > < td class = "fieldname" > < em > < a class = "anchor" id = "gga90d570104b5448c550bf04696a1cdda8aa9407c037f8443cdb65f085d7a75b3a6" > < / a > kStatus_LOG_BackendNotFound< / em > < / td > < td class = "fielddoc" >
< p > Backend not found. < / p >
< / td > < / tr >
< / table >
2023-01-26 02:53:53 +00:00
< / div >
< / div >
2024-04-12 13:21:49 +00:00
< a class = "anchor" id = "gac91d55174d383848b976a34de843748e" > < / a >
2023-01-26 02:53:53 +00:00
< div class = "memitem" >
< div class = "memproto" >
< table class = "memname" >
< tr >
2024-04-12 13:21:49 +00:00
< td class = "memname" > enum < a class = "el" href = "a00068.html#gac91d55174d383848b976a34de843748e" > log_level< / a > < / td >
2023-01-26 02:53:53 +00:00
< / tr >
< / table >
< / div > < div class = "memdoc" >
2024-04-12 13:21:49 +00:00
< p > The log level behavior is following,< br / >
If level is kLOG_LevelTrace, trace, debug, info, warning, error, and fatal of log level will be printed.< br / >
If level is kLOG_LevelDebug, debug, info, warning, error, and fatal of log level will be printed.< br / >
If level is kLOG_LevelInfo, info, warning, error, and fatal of log level will be printed.< br / >
If level is kLOG_LevelWarning, warning, error, and fatal of log level will be printed.< br / >
If level is kLOG_LevelError, error, and fatal of log level will be printed.< br / >
If level is kLOG_LevelFatal, only fatal of log level will be printed.< br / >
If level is kLOG_LevelNone, no log level will be printed.< br / >
< / p >
< table class = "fieldtable" >
< tr > < th colspan = "2" > Enumerator< / th > < / tr > < tr > < td class = "fieldname" > < em > < a class = "anchor" id = "ggac91d55174d383848b976a34de843748ea77e6f7c439bb3a12e07fa7c1af1d84e8" > < / a > kLOG_LevelNone< / em > < / td > < td class = "fielddoc" >
< p > LOG level none. < / p >
< / td > < / tr >
< tr > < td class = "fieldname" > < em > < a class = "anchor" id = "ggac91d55174d383848b976a34de843748ea7fd23432e4ccbdccb2cb83a4a6944d85" > < / a > kLOG_LevelFatal< / em > < / td > < td class = "fielddoc" >
< p > LOG level fatal. < / p >
< / td > < / tr >
< tr > < td class = "fieldname" > < em > < a class = "anchor" id = "ggac91d55174d383848b976a34de843748ea42717349ce3bb26bd225a76caecb6dee" > < / a > kLOG_LevelError< / em > < / td > < td class = "fielddoc" >
< p > LOG level error. < / p >
< / td > < / tr >
< tr > < td class = "fieldname" > < em > < a class = "anchor" id = "ggac91d55174d383848b976a34de843748ea4deeb3bbd94e3d5588961ede4527f0fe" > < / a > kLOG_LevelWarning< / em > < / td > < td class = "fielddoc" >
< p > LOG level warning. < / p >
< / td > < / tr >
< tr > < td class = "fieldname" > < em > < a class = "anchor" id = "ggac91d55174d383848b976a34de843748ea1f9fb8c886f50c93acdeb95673a1066a" > < / a > kLOG_LevelInfo< / em > < / td > < td class = "fielddoc" >
< p > LOG level info. < / p >
< / td > < / tr >
< tr > < td class = "fieldname" > < em > < a class = "anchor" id = "ggac91d55174d383848b976a34de843748eac2133b30465d8ce84fa3e8cb39b3e2bb" > < / a > kLOG_LevelDebug< / em > < / td > < td class = "fielddoc" >
< p > LOG level debug. < / p >
< / td > < / tr >
< tr > < td class = "fieldname" > < em > < a class = "anchor" id = "ggac91d55174d383848b976a34de843748ea7348c3a3fd6cc9c61eba36a59a916cd8" > < / a > kLOG_LevelTrace< / em > < / td > < td class = "fielddoc" >
< p > LOG level trace. < / p >
< / td > < / tr >
< / table >
2023-01-26 02:53:53 +00:00
< / div >
< / div >
2024-04-12 13:21:49 +00:00
< h2 class = "groupheader" > Function Documentation< / h2 >
< a class = "anchor" id = "ga8aa794955cb34997a4cfacca93bed663" > < / a >
2023-01-26 02:53:53 +00:00
< div class = "memitem" >
< div class = "memproto" >
< table class = "memname" >
< tr >
2024-04-12 13:21:49 +00:00
< td class = "memname" > < a class = "el" href = "a00068.html#gabfb4df30a98000a8d940731b9cd91873" > log_status_t< / a > LOG_Init < / td >
2023-01-26 02:53:53 +00:00
< td > (< / td >
2024-04-12 13:21:49 +00:00
< td class = "paramtype" > void  < / td >
< td class = "paramname" > < / td > < td > )< / td >
2023-01-26 02:53:53 +00:00
< td > < / td >
< / tr >
< / table >
< / div > < div class = "memdoc" >
2024-04-12 13:21:49 +00:00
< p > This function configures the log component with user-defined settings. The user can configure the configuration structure. Example below shows how to use this API to configure the log component. < / p >
< div class = "fragment" > < div class = "line" > * < a class = "code" href = "a00068.html#ga8aa794955cb34997a4cfacca93bed663" > LOG_Init< / a > ();< / div >
< div class = "line" > * < / div >
< / div > <!-- fragment --> < dl class = "retval" > < dt > Return values< / dt > < dd >
< table class = "retval" >
< tr > < td class = "paramname" > kStatus_LOG_Success< / td > < td > The Log component initialization succeed. < / td > < / tr >
< tr > < td class = "paramname" > kStatus_LOG_Initialized< / td > < td > Log component has been initialized. < / td > < / tr >
< tr > < td class = "paramname" > kStatus_LOG_LackResource< / td > < td > Lack of resource. < / td > < / tr >
2023-01-26 02:53:53 +00:00
< / table >
< / dd >
< / dl >
< / div >
< / div >
2024-04-12 13:21:49 +00:00
< a class = "anchor" id = "ga4a93abd060d96149634c3b5c1170c798" > < / a >
2023-01-26 02:53:53 +00:00
< div class = "memitem" >
< div class = "memproto" >
< table class = "memname" >
< tr >
2024-04-12 13:21:49 +00:00
< td class = "memname" > < a class = "el" href = "a00068.html#gabfb4df30a98000a8d940731b9cd91873" > log_status_t< / a > LOG_Deinit < / td >
2023-01-26 02:53:53 +00:00
< td > (< / td >
2024-04-12 13:21:49 +00:00
< td class = "paramtype" > void  < / td >
< td class = "paramname" > < / td > < td > )< / td >
2023-01-26 02:53:53 +00:00
< td > < / td >
< / tr >
< / table >
< / div > < div class = "memdoc" >
2024-04-12 13:21:49 +00:00
< p > This function de-initializes the log component.< / p >
< dl class = "retval" > < dt > Return values< / dt > < dd >
< table class = "retval" >
< tr > < td class = "paramname" > kStatus_LOG_Success< / td > < td > The log component de-initialization succeed. < / td > < / tr >
2023-01-26 02:53:53 +00:00
< / table >
< / dd >
< / dl >
< / div >
< / div >
2024-04-12 13:21:49 +00:00
< a class = "anchor" id = "ga3a12e6fa68c08fc6cba9a95554c70585" > < / a >
2023-01-26 02:53:53 +00:00
< div class = "memitem" >
< div class = "memproto" >
< table class = "memname" >
< tr >
2024-04-12 13:21:49 +00:00
< td class = "memname" > void LOG_Printf < / td >
2023-01-26 02:53:53 +00:00
< td > (< / td >
2024-04-12 13:21:49 +00:00
< td class = "paramtype" > < a class = "el" href = "a00068.html#ga083114bb3e7644aa7c6546b1bbb3a244" > log_module_t< / a > const *  < / td >
< td class = "paramname" > < em > module< / em > , < / td >
2023-01-26 02:53:53 +00:00
< / tr >
< tr >
< td class = "paramkey" > < / td >
< td > < / td >
2024-04-12 13:21:49 +00:00
< td class = "paramtype" > < a class = "el" href = "a00068.html#gae8208ffb3f6679921c91411a9737e4f1" > log_level_t< / a >   < / td >
< td class = "paramname" > < em > level< / em > , < / td >
2023-01-26 02:53:53 +00:00
< / tr >
< tr >
2024-04-12 13:21:49 +00:00
< td class = "paramkey" > < / td >
2023-01-26 02:53:53 +00:00
< td > < / td >
2024-04-12 13:21:49 +00:00
< td class = "paramtype" > unsigned int  < / td >
< td class = "paramname" > < em > timeStamp< / em > , < / td >
2023-01-26 02:53:53 +00:00
< / tr >
< tr >
< td class = "paramkey" > < / td >
< td > < / td >
2024-04-12 13:21:49 +00:00
< td class = "paramtype" > char const *  < / td >
< td class = "paramname" > < em > format< / em > , < / td >
2023-01-26 02:53:53 +00:00
< / tr >
< tr >
< td class = "paramkey" > < / td >
< td > < / td >
2024-04-12 13:21:49 +00:00
< td class = "paramtype" >   < / td >
< td class = "paramname" > < em > ...< / em >   < / td >
2023-01-26 02:53:53 +00:00
< / tr >
< tr >
< td > < / td >
< td > )< / td >
< td > < / td > < td > < / td >
< / tr >
< / table >
< / div > < div class = "memdoc" >
2024-04-12 13:21:49 +00:00
< p > This function prints the format log string. The timestamp and color are added to prefix by function. The log string color feature is set by the macro LOG_ENABLE_COLOR. The log string time stamp feature is set by the macro LOG_ENABLE_TIMESTAMP.< / p >
2023-01-26 02:53:53 +00:00
< dl class = "params" > < dt > Parameters< / dt > < dd >
< table class = "params" >
2024-04-12 13:21:49 +00:00
< tr > < td class = "paramname" > module< / td > < td > the log module. < / td > < / tr >
< tr > < td class = "paramname" > level< / td > < td > log level. < / td > < / tr >
< tr > < td class = "paramname" > timeStamp< / td > < td > current timestamp. < / td > < / tr >
< tr > < td class = "paramname" > format< / td > < td > formated log string. < / td > < / tr >
2023-01-26 02:53:53 +00:00
< / table >
< / dd >
< / dl >
< / div >
< / div >
2024-04-12 13:21:49 +00:00
< a class = "anchor" id = "ga41f2cb6b31db1d366b8be2b0bec0c78d" > < / a >
2023-01-26 02:53:53 +00:00
< div class = "memitem" >
< div class = "memproto" >
< table class = "memname" >
< tr >
2024-04-12 13:21:49 +00:00
< td class = "memname" > < a class = "el" href = "a00068.html#gabfb4df30a98000a8d940731b9cd91873" > log_status_t< / a > LOG_BackendRegister < / td >
2023-01-26 02:53:53 +00:00
< td > (< / td >
2024-04-12 13:21:49 +00:00
< td class = "paramtype" > < a class = "el" href = "a00068.html#ga5a08b81f153f5a62184005edf7f202e6" > log_backend_t< / a > *  < / td >
< td class = "paramname" > < em > backend< / em > < / td > < td > )< / td >
2023-01-26 02:53:53 +00:00
< td > < / td >
< / tr >
< / table >
< / div > < div class = "memdoc" >
2024-04-12 13:21:49 +00:00
< p > This function registers the backend. The parameter of the function is defined by macro LOG_BACKEND_DEFINE.< / p >
< p > Example below shows how to use this API to register the backend. step 1, define the backend node by calling LOG_BACKEND_DEFINE. < / p >
< div class = "fragment" > < div class = "line" > * < span class = "keyword" > static< / span > < span class = "keywordtype" > void< / span > puts(uint8_t *buffer, < span class = "keywordtype" > size_t< / span > length)< / div >
< div class = "line" > * {< / div >
< div class = "line" > * ...< / div >
< div class = "line" > * }< / div >
< div class = "line" > * < a class = "code" href = "a00068.html#ga3e611377ee5b2dcd95f310caa2803264" > LOG_BACKEND_DEFINE< / a > (test, puts);< / div >
< div class = "line" > * < / div >
< / div > <!-- fragment --> < p > step 2, call function LOG_BackendRegister to register the backend in same source file. < / p >
< div class = "fragment" > < div class = "line" > * < a class = "code" href = "a00068.html#ga41f2cb6b31db1d366b8be2b0bec0c78d" > LOG_BackendRegister< / a > (& test);< / div >
< div class = "line" > * < / div >
< / div > <!-- fragment --> < dl class = "params" > < dt > Parameters< / dt > < dd >
2023-01-26 02:53:53 +00:00
< table class = "params" >
2024-04-12 13:21:49 +00:00
< tr > < td class = "paramname" > backend< / td > < td > The new backend.< / td > < / tr >
2023-01-26 02:53:53 +00:00
< / table >
< / dd >
< / dl >
< dl class = "retval" > < dt > Return values< / dt > < dd >
< table class = "retval" >
2024-04-12 13:21:49 +00:00
< tr > < td class = "paramname" > kStatus_LOG_Success< / td > < td > The backend is registered. < / td > < / tr >
< tr > < td class = "paramname" > kStatus_LOG_Uninitialized< / td > < td > The log component is not initialized. < / td > < / tr >
< tr > < td class = "paramname" > kStatus_LOG_BackendExist< / td > < td > The backend has been registered. < / td > < / tr >
2023-01-26 02:53:53 +00:00
< / table >
< / dd >
< / dl >
< / div >
< / div >
2024-04-12 13:21:49 +00:00
< a class = "anchor" id = "gabf34b1a764160401a59f183e7047b171" > < / a >
2023-01-26 02:53:53 +00:00
< div class = "memitem" >
< div class = "memproto" >
< table class = "memname" >
< tr >
2024-04-12 13:21:49 +00:00
< td class = "memname" > < a class = "el" href = "a00068.html#gabfb4df30a98000a8d940731b9cd91873" > log_status_t< / a > LOG_BackendUnregister < / td >
2023-01-26 02:53:53 +00:00
< td > (< / td >
2024-04-12 13:21:49 +00:00
< td class = "paramtype" > < a class = "el" href = "a00068.html#ga5a08b81f153f5a62184005edf7f202e6" > log_backend_t< / a > *  < / td >
< td class = "paramname" > < em > backend< / em > < / td > < td > )< / td >
2023-01-26 02:53:53 +00:00
< td > < / td >
< / tr >
< / table >
< / div > < div class = "memdoc" >
2024-04-12 13:21:49 +00:00
< p > This function unregisters the backend.< / p >
2023-01-26 02:53:53 +00:00
< dl class = "params" > < dt > Parameters< / dt > < dd >
< table class = "params" >
2024-04-12 13:21:49 +00:00
< tr > < td class = "paramname" > backend< / td > < td > The backend.< / td > < / tr >
< / table >
< / dd >
< / dl >
< dl class = "retval" > < dt > Return values< / dt > < dd >
< table class = "retval" >
< tr > < td class = "paramname" > kStatus_LOG_Success< / td > < td > The backend is unregistered. < / td > < / tr >
< tr > < td class = "paramname" > kStatus_LOG_Uninitialized< / td > < td > The log component is not initialized. < / td > < / tr >
< tr > < td class = "paramname" > kStatus_LOG_BackendNotFound< / td > < td > the backend is not found. < / td > < / tr >
2023-01-26 02:53:53 +00:00
< / table >
< / dd >
< / dl >
< / div >
< / div >
2024-04-12 13:21:49 +00:00
< a class = "anchor" id = "gab6b65462157ea929728bc31f068d06d9" > < / a >
2023-01-26 02:53:53 +00:00
< div class = "memitem" >
< div class = "memproto" >
< table class = "memname" >
< tr >
2024-04-12 13:21:49 +00:00
< td class = "memname" > < a class = "el" href = "a00068.html#gabfb4df30a98000a8d940731b9cd91873" > log_status_t< / a > LOG_SetTimestamp < / td >
2023-01-26 02:53:53 +00:00
< td > (< / td >
2024-04-12 13:21:49 +00:00
< td class = "paramtype" > < a class = "el" href = "a00068.html#ga5535c6738db402373c016fdc940b53e1" > log_get_timestamp_callback_t< / a >   < / td >
< td class = "paramname" > < em > getTimeStamp< / em > < / td > < td > )< / td >
2023-01-26 02:53:53 +00:00
< td > < / td >
< / tr >
< / table >
< / div > < div class = "memdoc" >
2024-04-12 13:21:49 +00:00
< p > This function sets the get timestamp function callback. The feature is controlled by the macro LOG_ENABLE_TIMESTAMP.< / p >
2023-01-26 02:53:53 +00:00
< dl class = "params" > < dt > Parameters< / dt > < dd >
< table class = "params" >
2024-04-12 13:21:49 +00:00
< tr > < td class = "paramname" > getTimeStamp< / td > < td > get time stamp function callback.< / td > < / tr >
2023-01-26 02:53:53 +00:00
< / table >
< / dd >
< / dl >
< dl class = "retval" > < dt > Return values< / dt > < dd >
< table class = "retval" >
2024-04-12 13:21:49 +00:00
< tr > < td class = "paramname" > kStatus_LOG_Success< / td > < td > Succeed. < / td > < / tr >
< tr > < td class = "paramname" > kStatus_LOG_Uninitialized< / td > < td > The log component is not initialized. < / td > < / tr >
2023-01-26 02:53:53 +00:00
< / table >
< / dd >
< / dl >
< / div >
< / div >
2024-04-12 13:21:49 +00:00
< a class = "anchor" id = "gad8962b569a5874f7618eeca3cad589a6" > < / a >
2023-01-26 02:53:53 +00:00
< div class = "memitem" >
< div class = "memproto" >
< table class = "memname" >
< tr >
2024-04-12 13:21:49 +00:00
< td class = "memname" > unsigned int LOG_GetTimestamp < / td >
2023-01-26 02:53:53 +00:00
< td > (< / td >
2024-04-12 13:21:49 +00:00
< td class = "paramtype" > void  < / td >
< td class = "paramname" > < / td > < td > )< / td >
2023-01-26 02:53:53 +00:00
< td > < / td >
< / tr >
< / table >
< / div > < div class = "memdoc" >
2024-04-12 13:21:49 +00:00
< p > This function gets current timestamp. The feature is controlled by the macro LOG_ENABLE_TIMESTAMP.< / p >
< dl class = "section return" > < dt > Returns< / dt > < dd > Current timestamp. < / dd > < / dl >
2023-01-26 02:53:53 +00:00
< / div >
< / div >
< / div > <!-- contents -->
< / div > <!-- doc - content -->
<!-- HTML footer for doxygen 1.8.5 -->
<!-- start footer part -->
< div id = "nav-path" class = "navpath" > <!-- id is needed for treeview function! -->
< ul class = "foot" >
< li class = "footer" > © 2016 NXP Semiconductors. All rights reserved.
< / li >
< / ul >
< / div >
< / body >
< / html >