2022-04-08 14:42:47 +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 configuration< / title >
2022-04-08 14:42:47 +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 >
2022-04-08 14:42:47 +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" >
2023-01-26 02:53:53 +00:00
$(document).ready(function(){initNavTree('a00290.html','');});
2022-04-08 14:42:47 +00:00
< / 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 = "#define-members" > Macros< / a > < / div >
2022-04-08 14:42:47 +00:00
< div class = "headertitle" >
2024-04-12 13:21:49 +00:00
< div class = "title" > Log configuration< div class = "ingroups" > < a class = "el" href = "a00068.html" > Log< / a > < / div > < / div > < / div >
2022-04-08 14:42:47 +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 configurations of the log component. < / p >
2022-04-08 14:42:47 +00:00
< table class = "memberdecls" >
2024-04-12 13:21:49 +00:00
< tr class = "heading" > < td colspan = "2" > < h2 class = "groupheader" > < a name = "define-members" > < / a >
Macros< / h2 > < / td > < / tr >
< tr class = "memitem:gaba0050d0d9182386e51d25ec355f4f8d" > < td class = "memItemLeft" align = "right" valign = "top" > #define  < / td > < td class = "memItemRight" valign = "bottom" > < a class = "el" href = "a00290.html#gaba0050d0d9182386e51d25ec355f4f8d" > LOG_ENABLE< / a >       0< / td > < / tr >
< tr class = "memdesc:gaba0050d0d9182386e51d25ec355f4f8d" > < td class = "mdescLeft" >   < / td > < td class = "mdescRight" > Whether to enable the log feature in the specific module, 1 - enable, 0 - disable. < a href = "#gaba0050d0d9182386e51d25ec355f4f8d" > More...< / a > < br / > < / td > < / tr >
< tr class = "separator:gaba0050d0d9182386e51d25ec355f4f8d" > < td class = "memSeparator" colspan = "2" >   < / td > < / tr >
< tr class = "memitem:ga27415e21704bb27a5157e669786eac97" > < td class = "memItemLeft" align = "right" valign = "top" > #define  < / td > < td class = "memItemRight" valign = "bottom" > < a class = "el" href = "a00290.html#ga27415e21704bb27a5157e669786eac97" > LOG_ENABLE_COLOR< / a >       1< / td > < / tr >
< tr class = "memdesc:ga27415e21704bb27a5157e669786eac97" > < td class = "mdescLeft" >   < / td > < td class = "mdescRight" > Whether enable log color global feature, 1 - enable, 0 - disable. < a href = "#ga27415e21704bb27a5157e669786eac97" > More...< / a > < br / > < / td > < / tr >
< tr class = "separator:ga27415e21704bb27a5157e669786eac97" > < td class = "memSeparator" colspan = "2" >   < / td > < / tr >
< tr class = "memitem:ga58bf9fe0873507b1448aabf42ac85456" > < td class = "memItemLeft" align = "right" valign = "top" > #define  < / td > < td class = "memItemRight" valign = "bottom" > < a class = "el" href = "a00290.html#ga58bf9fe0873507b1448aabf42ac85456" > LOG_ENABLE_TIMESTAMP< / a >       1< / td > < / tr >
< tr class = "memdesc:ga58bf9fe0873507b1448aabf42ac85456" > < td class = "mdescLeft" >   < / td > < td class = "mdescRight" > Whether enable timestamp global feature for log, 1 - enable, 0 - disable. < a href = "#ga58bf9fe0873507b1448aabf42ac85456" > More...< / a > < br / > < / td > < / tr >
< tr class = "separator:ga58bf9fe0873507b1448aabf42ac85456" > < td class = "memSeparator" colspan = "2" >   < / td > < / tr >
< tr class = "memitem:gab27aae1b101419a9da0aa8ed983deb5b" > < td class = "memItemLeft" align = "right" valign = "top" > #define  < / td > < td class = "memItemRight" valign = "bottom" > < a class = "el" href = "a00290.html#gab27aae1b101419a9da0aa8ed983deb5b" > LOG_ENABLE_FILE_WITH_PATH< / a >       0< / td > < / tr >
< tr class = "memdesc:gab27aae1b101419a9da0aa8ed983deb5b" > < td class = "mdescLeft" >   < / td > < td class = "mdescRight" > Whether enable source file name with path information global feature, 1 - enable, 0 - disable. < a href = "#gab27aae1b101419a9da0aa8ed983deb5b" > More...< / a > < br / > < / td > < / tr >
< tr class = "separator:gab27aae1b101419a9da0aa8ed983deb5b" > < td class = "memSeparator" colspan = "2" >   < / td > < / tr >
< tr class = "memitem:ga6fe7dc82161dc83a452cd9da3f49626d" > < td class = "memItemLeft" align = "right" valign = "top" > #define  < / td > < td class = "memItemRight" valign = "bottom" > < a class = "el" href = "a00290.html#ga6fe7dc82161dc83a452cd9da3f49626d" > LOG_MAX_MEESSAGE_LENGTH< / a >       128< / td > < / tr >
< tr class = "memdesc:ga6fe7dc82161dc83a452cd9da3f49626d" > < td class = "mdescLeft" >   < / td > < td class = "mdescRight" > Set the max message length, the default value is 128. < a href = "#ga6fe7dc82161dc83a452cd9da3f49626d" > More...< / a > < br / > < / td > < / tr >
< tr class = "separator:ga6fe7dc82161dc83a452cd9da3f49626d" > < td class = "memSeparator" colspan = "2" >   < / td > < / tr >
< tr class = "memitem:ga2ce83e763f0ec2ebc3bd534a41802190" > < td class = "memItemLeft" align = "right" valign = "top" > #define  < / td > < td class = "memItemRight" valign = "bottom" > < a class = "el" href = "a00290.html#ga2ce83e763f0ec2ebc3bd534a41802190" > LOG_ENABLE_ASYNC_MODE< / a >       0< / td > < / tr >
< tr class = "memdesc:ga2ce83e763f0ec2ebc3bd534a41802190" > < td class = "mdescLeft" >   < / td > < td class = "mdescRight" > Whether enable asynchronous log mode feature, 1 - enable, 0 - disable. < a href = "#ga2ce83e763f0ec2ebc3bd534a41802190" > More...< / a > < br / > < / td > < / tr >
< tr class = "separator:ga2ce83e763f0ec2ebc3bd534a41802190" > < td class = "memSeparator" colspan = "2" >   < / td > < / tr >
2022-04-08 14:42:47 +00:00
< / table >
2024-04-12 13:21:49 +00:00
< h2 class = "groupheader" > Macro Definition Documentation< / h2 >
< a class = "anchor" id = "gaba0050d0d9182386e51d25ec355f4f8d" > < / 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_ENABLE      0< / 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 feature is used to configure the log feature for the specific module. 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" > * #define < a class = "code" href = "a00290.html#gaba0050d0d9182386e51d25ec355f4f8d" > LOG_ENABLE< / a > 1< / div >
< div class = "line" > * < / 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" > * #define < a class = "code" href = "a00290.html#gaba0050d0d9182386e51d25ec355f4f8d" > LOG_ENABLE< / a > module_LOG_ENABLED_FLAG< / div >
< div class = "line" > * < / div >
< / div > <!-- fragment --> < / dd > < / dl >
< p > step 2, include the log component header file, likes as, < / p >
< div class = "fragment" > < div class = "line" > * #include < span class = "stringliteral" > " fsl_component_log.h" < / span > < / div >
< div class = "line" > * < / 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 class = "line" > * < / 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" > * #define < a class = "code" href = "a00290.html#gaba0050d0d9182386e51d25ec355f4f8d" > LOG_ENABLE< / a > MODULE1_CONFIG_LOG_ENABLE< / div >
< div class = "line" > * #include < span class = "stringliteral" > " 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 class = "line" > * < / div >
< / div > <!-- fragment --> < p > In source file 2, < / p >
< div class = "fragment" > < div class = "line" > * #define < a class = "code" href = "a00290.html#gaba0050d0d9182386e51d25ec355f4f8d" > LOG_ENABLE< / a > MODULE2_CONFIG_LOG_ENABLE< / div >
< div class = "line" > * #include < span class = "stringliteral" > " 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 class = "line" > * < / div >
< / div > <!-- fragment -->
< / div >
< / div >
< a class = "anchor" id = "ga27415e21704bb27a5157e669786eac97" > < / a >
< div class = "memitem" >
< div class = "memproto" >
< table class = "memname" >
< tr >
< td class = "memname" > #define LOG_ENABLE_COLOR      1< / td >
< / tr >
< / table >
< / div > < div class = "memdoc" >
< p > The feature is used to configure the log color feature for all of log component.< br / >
The feature should be defined in project setting.< br / >
Below shows how to configure in your project if you want to disable the feature.< br / >
For IAR, right click project and select "Options", define it in "C/C++ Compiler-> Preprocessor-> Defined symbols".< br / >
For KEIL, click "Options for Target...", define it in "C/C++-> Preprocessor Symbols-> Define".< br / >
For ARMGCC, open CmakeLists.txt and add the following lines,< br / >
"SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DLOG_ENABLE_COLOR=0")" for debug target.< br / >
"SET(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -DLOG_ENABLE_COLOR=0")" for release target.< br / >
For MCUxpresso, right click project and select "Properties", define it in "C/C++ Build-> Settings-> MCU C
Complier-> Preprocessor".< br / >
< / p >
< / div >
< / div >
< a class = "anchor" id = "ga58bf9fe0873507b1448aabf42ac85456" > < / a >
< div class = "memitem" >
< div class = "memproto" >
< table class = "memname" >
< tr >
< td class = "memname" > #define LOG_ENABLE_TIMESTAMP      1< / td >
< / tr >
< / table >
< / div > < div class = "memdoc" >
< p > The feature is used to configure the log timestamp feature for all of log component.< br / >
The feature should be defined in project setting.< br / >
Below shows how to configure in your project if you want to disable the feature.< br / >
For IAR, right click project and select "Options", define it in "C/C++ Compiler-> Preprocessor-> Defined symbols".< br / >
For KEIL, click "Options for Target...", define it in "C/C++-> Preprocessor Symbols-> Define".< br / >
For ARMGCC, open CmakeLists.txt and add the following lines,< br / >
"SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DLOG_ENABLE_TIMESTAMP=0")" for debug target.< br / >
"SET(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -DLOG_ENABLE_TIMESTAMP=0")" for release target.< br / >
For MCUxpresso, right click project and select "Properties", define it in "C/C++ Build-> Settings-> MCU C
Complier-> Preprocessor".< br / >
< / p >
< / div >
< / div >
< a class = "anchor" id = "gab27aae1b101419a9da0aa8ed983deb5b" > < / a >
< div class = "memitem" >
< div class = "memproto" >
< table class = "memname" >
< tr >
< td class = "memname" > #define LOG_ENABLE_FILE_WITH_PATH      0< / td >
< / tr >
< / table >
< / div > < div class = "memdoc" >
< p > The feature is used to configure the source file name with path information feature for all of log component.< br / >
The feature should be defined in project setting.< br / >
Below shows how to configure in your project if you want to enable the feature.< br / >
For IAR, right click project and select "Options", define it in "C/C++
Compiler-> Preprocessor-> Defined symbols".< br / >
For KEIL, click "Options for Target...", define it in "C/C++-> Preprocessor Symbols-> Define".< br / >
For ARMGCC, open CmakeLists.txt and add the following lines,< br / >
"SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DLOG_ENABLE_FILE_WITH_PATH=1")" for debug target.< br / >
"SET(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -DLOG_ENABLE_FILE_WITH_PATH=1")" for release target.< br / >
For MCUxpresso, right click project and select "Properties", define it in "C/C++ Build-> Settings-> MCU C
Complier-> Preprocessor".< br / >
< / p >
< / div >
< / div >
< a class = "anchor" id = "ga6fe7dc82161dc83a452cd9da3f49626d" > < / a >
< div class = "memitem" >
< div class = "memproto" >
< table class = "memname" >
< tr >
< td class = "memname" > #define LOG_MAX_MEESSAGE_LENGTH      128< / td >
< / tr >
< / table >
< / div > < div class = "memdoc" >
< p > The feature is used to set the max message length, the default value is 128.< br / >
The feature should be defined in project setting.< br / >
Below shows how to configure in your project if you want to enable the feature.< br / >
For IAR, right click project and select "Options", define it in "C/C++
Compiler-> Preprocessor-> Defined symbols".< br / >
For KEIL, click "Options for Target...", define it in "C/C++-> Preprocessor Symbols-> Define".< br / >
For ARMGCC, open CmakeLists.txt and add the following lines,< br / >
"SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DLOG_MAX_MEESSAGE_LENGTH=128")" for debug target.< br / >
"SET(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -DLOG_MAX_MEESSAGE_LENGTH=128")" for release target.< br / >
For MCUxpresso, right click project and select "Properties", define it in "C/C++ Build-> Settings-> MCU C
Complier-> Preprocessor".< br / >
< / p >
2023-01-26 02:53:53 +00:00
< / div >
< / div >
2024-04-12 13:21:49 +00:00
< a class = "anchor" id = "ga2ce83e763f0ec2ebc3bd534a41802190" > < / 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_ENABLE_ASYNC_MODE      0< / 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 feature is used to enable asynchronous log mode feature.< br / >
The feature should be defined in project setting.< br / >
Below shows how to configure in your project if you want to enable the feature.< br / >
For IAR, right click project and select "Options", define it in "C/C++
Compiler-> Preprocessor-> Defined symbols".< br / >
For KEIL, click "Options for Target...", define it in "C/C++-> Preprocessor Symbols-> Define".< br / >
For ARMGCC, open CmakeLists.txt and add the following lines,< br / >
"SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DLOG_ENABLE_ASYNC_MODE=1")" for debug target.< br / >
"SET(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -DLOG_ENABLE_ASYNC_MODE=1")" for release target.< br / >
For MCUxpresso, right click project and select "Properties", define it in "C/C++ Build-> Settings-> MCU C
Complier-> Preprocessor".< br / >
< / p >
2023-01-26 02:53:53 +00:00
< / div >
< / div >
2022-04-08 14:42:47 +00:00
< / 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 >