{"id":11084,"date":"2022-04-06T07:03:36","date_gmt":"2022-04-06T07:03:36","guid":{"rendered":"https:\/\/imperix.com\/doc\/?p=11084"},"modified":"2026-02-26T10:55:03","modified_gmt":"2026-02-26T10:55:03","slug":"log-message","status":"publish","type":"post","link":"https:\/\/imperix.com\/doc\/software\/log-message","title":{"rendered":"LOG &#8211; Write a log message"},"content":{"rendered":"\n<p>This block writes a user-defined message in the log module of <a href=\"https:\/\/imperix.com\/software\/cockpit\">Cockpit<\/a>.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"569\" height=\"277\" src=\"https:\/\/imperix.com\/doc\/wp-content\/uploads\/2022\/04\/Screenshot_Log_module_Cockpit.png\" alt=\"\" class=\"wp-image-11244\" srcset=\"https:\/\/imperix.com\/doc\/wp-content\/uploads\/2022\/04\/Screenshot_Log_module_Cockpit.png 569w, https:\/\/imperix.com\/doc\/wp-content\/uploads\/2022\/04\/Screenshot_Log_module_Cockpit-300x146.png 300w\" sizes=\"auto, (max-width: 569px) 100vw, 569px\" \/><figcaption class=\"wp-element-caption\">Log module of Cockpit<\/figcaption><\/figure>\n<\/div>\n\n\n<p>Numerical values can be inserted into the message using the conversion specifier &#8220;<code>%f<\/code>&#8220;, that will take to the value of the second input signal. This block only supports floating-point numbers. Optionally, the number of digits displayed after the decimal point can be specified using the precision modifier <code>\".\"<\/code>. Here are some examples:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th><code>Log message<\/code> field<\/th><th>Input value<\/th><th>Message displayed in the log module<\/th><\/tr><\/thead><tbody><tr><td>The value is: %f<\/td><td>3.141592653<\/td><td>The value is: 3.141593<\/td><\/tr><tr><td>The value is: %.3f<\/td><td>3.141592653<\/td><td>The value is: 3.142<\/td><\/tr><tr><td>The value is: %.0f<\/td><td>3.141592653<\/td><td>The value is: 3<\/td><\/tr><tr><td>The value is: %f<\/td><td>3<\/td><td>The value is: 3.000000<\/td><\/tr><tr><td>The value is: %.3f<\/td><td>3<\/td><td>The value is: 3.000<\/td><\/tr><tr><td>The value is: %.0f<\/td><td>3<\/td><td>The value is: 3<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>Note that the maximum length of a log message is 256 characters and the maximum amount of different log messages is 128.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-simulink-block\">Simulink block<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-signal-specification\">Signal specification<\/h3>\n\n\n\n<div class=\"wp-block-columns is-layout-flex wp-container-core-columns-is-layout-9d6595d7 wp-block-columns-is-layout-flex\">\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\" style=\"flex-basis:66.66%\">\n<ul class=\"wp-block-list\">\n<li>The first input is a trigger port that generates a log message when its value rises from a negative or zero value to a positive value.<\/li>\n\n\n\n<li>The second input is only visible when <code>Include variables in message<\/code> is checked. It is used to input numerical value(s) into the message. The value(s) are sampled when the log message is triggered.<br>Its width is defined by the parameter <code>Number of variables<\/code> and must also correspond to the number of conversion specifiers contained in the message.<\/li>\n<\/ul>\n<\/div>\n\n\n\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\" style=\"flex-basis:33.33%\"><div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"104\" height=\"57\" src=\"https:\/\/imperix.com\/doc\/wp-content\/uploads\/2022\/03\/Screenshot_Log-2.png\" alt=\"\" class=\"wp-image-11118\"\/><\/figure>\n<\/div><\/div>\n<\/div>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-parameters\">Parameters<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>Log message<\/code> is the message that will be displayed in the log module of Cockpit.<\/li>\n\n\n\n<li><code>String type<\/code> indicates whether the <code>Log message<\/code> field contains a literal text string or an expression that should be evaluated.<\/li>\n\n\n\n<li><code>Severity<\/code> defines the type of message (Info, Warning, or Error). The log module of Cockpit lets you filter the displayed message by severity.<\/li>\n\n\n\n<li><code>Include variables in message<\/code> indicates if numerical values are inserted in the message using the <code>%f<\/code> placeholder. If checked, a second port appears to input the numerical values.<\/li>\n\n\n\n<li><code>Number of variables<\/code>&nbsp;is the number of numerical values that are inserted into the message. This field is only visible if <code>Include variables in message<\/code> is checked.<\/li>\n<\/ul>\n\n\n\n<div class=\"wp-block-columns is-layout-flex wp-container-core-columns-is-layout-9d6595d7 wp-block-columns-is-layout-flex\">\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\"><div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"424\" height=\"463\" src=\"https:\/\/imperix.com\/doc\/wp-content\/uploads\/2022\/04\/Mask_dialog_Log.png\" alt=\"\" class=\"wp-image-11237\" srcset=\"https:\/\/imperix.com\/doc\/wp-content\/uploads\/2022\/04\/Mask_dialog_Log.png 424w, https:\/\/imperix.com\/doc\/wp-content\/uploads\/2022\/04\/Mask_dialog_Log-275x300.png 275w\" sizes=\"auto, (max-width: 424px) 100vw, 424px\" \/><\/figure>\n<\/div><\/div>\n<\/div>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-plecs-block\">PLECS block<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-signal-specification-1\">Signal specification<\/h3>\n\n\n\n<div class=\"wp-block-columns is-layout-flex wp-container-core-columns-is-layout-9d6595d7 wp-block-columns-is-layout-flex\">\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\" style=\"flex-basis:66.66%\">\n<ul class=\"wp-block-list\">\n<li>The first input is a trigger port that generates a log message when its value rises from a negative or zero value to a positive value.<\/li>\n\n\n\n<li>The second input is only visible when <code>Include variables in message<\/code> is checked. It is used to input numerical value(s) into the message. The value(s) are sampled when the log message is triggered.<\/li>\n\n\n\n<li>Its width is defined by the parameter <code>Number of variables<\/code> and must also correspond to the number of conversion specifiers contained in the message.<\/li>\n<\/ul>\n<\/div>\n\n\n\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\" style=\"flex-basis:33.33%\"><div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"112\" height=\"60\" src=\"https:\/\/imperix.com\/doc\/wp-content\/uploads\/2022\/04\/LOGmessage-1.png\" alt=\"\" class=\"wp-image-11324\"\/><\/figure>\n<\/div><\/div>\n<\/div>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-parameters-1\">Parameters<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>Log message<\/code> is the message that will be displayed in the log module of Cockpit.<\/li>\n\n\n\n<li><code>String type<\/code> indicates whether the <code>Log message<\/code> field contains a literal text string or an expression that should be evaluated.<\/li>\n\n\n\n<li><code>Severity<\/code> defines the type of message (Info, Warning, or Error). The log module of Cockpit lets you filter the displayed message by severity.<\/li>\n\n\n\n<li><code>Include variables in message<\/code> indicates if numerical values are inserted in the message using the <code>%f<\/code> placeholder. If checked, a second port appears to input the numerical values.<\/li>\n\n\n\n<li><code>Number of variables<\/code>&nbsp;is the number of numerical values that are inserted into the message. This field is only visible if <code>Include variables in message<\/code> is checked.<\/li>\n<\/ul>\n\n\n\n<div class=\"wp-block-columns is-layout-flex wp-container-core-columns-is-layout-9d6595d7 wp-block-columns-is-layout-flex\">\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\"><div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"443\" height=\"420\" src=\"https:\/\/imperix.com\/doc\/wp-content\/uploads\/2022\/04\/image-1.png\" alt=\"\" class=\"wp-image-11357\" srcset=\"https:\/\/imperix.com\/doc\/wp-content\/uploads\/2022\/04\/image-1.png 443w, https:\/\/imperix.com\/doc\/wp-content\/uploads\/2022\/04\/image-1-300x284.png 300w\" sizes=\"auto, (max-width: 443px) 100vw, 443px\" \/><\/figure>\n<\/div><\/div>\n<\/div>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-c-functions\">C++ functions<\/h2>\n\n\n<style>.kt-accordion-id11084_a5a0b8-b9 .kt-accordion-inner-wrap{column-gap:var(--global-kb-gap-md, 2rem);row-gap:1px;}.kt-accordion-id11084_a5a0b8-b9 .kt-accordion-panel-inner{border-top:2px solid transparent;border-right:2px solid transparent;border-bottom:2px solid transparent;border-left:2px solid transparent;border-top-left-radius:2px;border-top-right-radius:2px;border-bottom-right-radius:2px;border-bottom-left-radius:2px;background:#ffffff;padding-top:20px;padding-right:20px;padding-bottom:20px;padding-left:20px;}.kt-accordion-id11084_a5a0b8-b9 > .kt-accordion-inner-wrap > .wp-block-kadence-pane > .kt-accordion-header-wrap > .kt-blocks-accordion-header{border-top:2px solid #f2f2f2;border-right:2px solid #f2f2f2;border-bottom:2px solid #f2f2f2;border-left:2px solid #f2f2f2;border-top-left-radius:2px;border-top-right-radius:2px;border-bottom-right-radius:2px;border-bottom-left-radius:2px;background:#ffffff;font-size:16px;line-height:24px;letter-spacing:0px;font-weight:bold;text-transform:none;color:var(--global-palette3, #1A202C);padding-top:12px;padding-right:10px;padding-bottom:8px;padding-left:16px;}.kt-accordion-id11084_a5a0b8-b9:not( .kt-accodion-icon-style-basiccircle ):not( .kt-accodion-icon-style-xclosecircle ):not( .kt-accodion-icon-style-arrowcircle )  > .kt-accordion-inner-wrap > .wp-block-kadence-pane > .kt-accordion-header-wrap .kt-blocks-accordion-icon-trigger:after, .kt-accordion-id11084_a5a0b8-b9:not( .kt-accodion-icon-style-basiccircle ):not( .kt-accodion-icon-style-xclosecircle ):not( .kt-accodion-icon-style-arrowcircle )  > .kt-accordion-inner-wrap > .wp-block-kadence-pane > .kt-accordion-header-wrap .kt-blocks-accordion-icon-trigger:before{background:var(--global-palette3, #1A202C);}.kt-accordion-id11084_a5a0b8-b9:not( .kt-accodion-icon-style-basic ):not( .kt-accodion-icon-style-xclose ):not( .kt-accodion-icon-style-arrow ) .kt-blocks-accordion-icon-trigger{background:var(--global-palette3, #1A202C);}.kt-accordion-id11084_a5a0b8-b9:not( .kt-accodion-icon-style-basic ):not( .kt-accodion-icon-style-xclose ):not( .kt-accodion-icon-style-arrow ) .kt-blocks-accordion-icon-trigger:after, .kt-accordion-id11084_a5a0b8-b9:not( .kt-accodion-icon-style-basic ):not( .kt-accodion-icon-style-xclose ):not( .kt-accodion-icon-style-arrow ) .kt-blocks-accordion-icon-trigger:before{background:#ffffff;}.kt-accordion-id11084_a5a0b8-b9 > .kt-accordion-inner-wrap > .wp-block-kadence-pane > .kt-accordion-header-wrap > .kt-blocks-accordion-header:hover, \n\t\t\t\tbody:not(.hide-focus-outline) .kt-accordion-id11084_a5a0b8-b9 .kt-blocks-accordion-header:focus-visible{color:#444444;background:#ffffff;border-top:2px solid #eeeeee;border-right:2px solid #eeeeee;border-bottom:2px solid #eeeeee;border-left:2px solid #eeeeee;}.kt-accordion-id11084_a5a0b8-b9:not( .kt-accodion-icon-style-basiccircle ):not( .kt-accodion-icon-style-xclosecircle ):not( .kt-accodion-icon-style-arrowcircle ) .kt-accordion-header-wrap .kt-blocks-accordion-header:hover .kt-blocks-accordion-icon-trigger:after, .kt-accordion-id11084_a5a0b8-b9:not( .kt-accodion-icon-style-basiccircle ):not( .kt-accodion-icon-style-xclosecircle ):not( .kt-accodion-icon-style-arrowcircle ) .kt-accordion-header-wrap .kt-blocks-accordion-header:hover .kt-blocks-accordion-icon-trigger:before, body:not(.hide-focus-outline) .kt-accordion-id11084_a5a0b8-b9:not( .kt-accodion-icon-style-basiccircle ):not( .kt-accodion-icon-style-xclosecircle ):not( .kt-accodion-icon-style-arrowcircle ) .kt-blocks-accordion--visible .kt-blocks-accordion-icon-trigger:after, body:not(.hide-focus-outline) .kt-accordion-id11084_a5a0b8-b9:not( .kt-accodion-icon-style-basiccircle ):not( .kt-accodion-icon-style-xclosecircle ):not( .kt-accodion-icon-style-arrowcircle ) .kt-blocks-accordion-header:focus-visible .kt-blocks-accordion-icon-trigger:before{background:#444444;}.kt-accordion-id11084_a5a0b8-b9:not( .kt-accodion-icon-style-basic ):not( .kt-accodion-icon-style-xclose ):not( .kt-accodion-icon-style-arrow ) .kt-accordion-header-wrap .kt-blocks-accordion-header:hover .kt-blocks-accordion-icon-trigger, body:not(.hide-focus-outline) .kt-accordion-id11084_a5a0b8-b9:not( .kt-accodion-icon-style-basic ):not( .kt-accodion-icon-style-xclose ):not( .kt-accodion-icon-style-arrow ) .kt-accordion-header-wrap .kt-blocks-accordion-header:focus-visible .kt-blocks-accordion-icon-trigger{background:#444444;}.kt-accordion-id11084_a5a0b8-b9:not( .kt-accodion-icon-style-basic ):not( .kt-accodion-icon-style-xclose ):not( .kt-accodion-icon-style-arrow ) .kt-accordion-header-wrap .kt-blocks-accordion-header:hover .kt-blocks-accordion-icon-trigger:after, .kt-accordion-id11084_a5a0b8-b9:not( .kt-accodion-icon-style-basic ):not( .kt-accodion-icon-style-xclose ):not( .kt-accodion-icon-style-arrow ) .kt-accordion-header-wrap .kt-blocks-accordion-header:hover .kt-blocks-accordion-icon-trigger:before, body:not(.hide-focus-outline) .kt-accordion-id11084_a5a0b8-b9:not( .kt-accodion-icon-style-basic ):not( .kt-accodion-icon-style-xclose ):not( .kt-accodion-icon-style-arrow ) .kt-accordion-header-wrap .kt-blocks-accordion-header:focus-visible .kt-blocks-accordion-icon-trigger:after, body:not(.hide-focus-outline) .kt-accordion-id11084_a5a0b8-b9:not( .kt-accodion-icon-style-basic ):not( .kt-accodion-icon-style-xclose ):not( .kt-accodion-icon-style-arrow ) .kt-accordion-header-wrap .kt-blocks-accordion-header:focus-visible .kt-blocks-accordion-icon-trigger:before{background:#ffffff;}.kt-accordion-id11084_a5a0b8-b9 .kt-accordion-header-wrap .kt-blocks-accordion-header:focus-visible,\n\t\t\t\t.kt-accordion-id11084_a5a0b8-b9 > .kt-accordion-inner-wrap > .wp-block-kadence-pane > .kt-accordion-header-wrap > .kt-blocks-accordion-header.kt-accordion-panel-active{color:var(--global-palette3, #1A202C);background:var(--global-palette9, #ffffff);border-top:2px solid var(--global-palette6, #718096);border-right:2px solid var(--global-palette6, #718096);border-bottom:2px solid var(--global-palette6, #718096);border-left:2px solid var(--global-palette6, #718096);}.kt-accordion-id11084_a5a0b8-b9:not( .kt-accodion-icon-style-basiccircle ):not( .kt-accodion-icon-style-xclosecircle ):not( .kt-accodion-icon-style-arrowcircle )  > .kt-accordion-inner-wrap > .wp-block-kadence-pane > .kt-accordion-header-wrap > .kt-blocks-accordion-header.kt-accordion-panel-active .kt-blocks-accordion-icon-trigger:after, .kt-accordion-id11084_a5a0b8-b9:not( .kt-accodion-icon-style-basiccircle ):not( .kt-accodion-icon-style-xclosecircle ):not( .kt-accodion-icon-style-arrowcircle )  > .kt-accordion-inner-wrap > .wp-block-kadence-pane > .kt-accordion-header-wrap > .kt-blocks-accordion-header.kt-accordion-panel-active .kt-blocks-accordion-icon-trigger:before{background:var(--global-palette3, #1A202C);}.kt-accordion-id11084_a5a0b8-b9:not( .kt-accodion-icon-style-basic ):not( .kt-accodion-icon-style-xclose ):not( .kt-accodion-icon-style-arrow ) .kt-blocks-accordion-header.kt-accordion-panel-active .kt-blocks-accordion-icon-trigger{background:var(--global-palette3, #1A202C);}.kt-accordion-id11084_a5a0b8-b9:not( .kt-accodion-icon-style-basic ):not( .kt-accodion-icon-style-xclose ):not( .kt-accodion-icon-style-arrow ) .kt-blocks-accordion-header.kt-accordion-panel-active .kt-blocks-accordion-icon-trigger:after, .kt-accordion-id11084_a5a0b8-b9:not( .kt-accodion-icon-style-basic ):not( .kt-accodion-icon-style-xclose ):not( .kt-accodion-icon-style-arrow ) .kt-blocks-accordion-header.kt-accordion-panel-active .kt-blocks-accordion-icon-trigger:before{background:var(--global-palette9, #ffffff);}@media all and (max-width: 1024px){.kt-accordion-id11084_a5a0b8-b9 .kt-accordion-panel-inner{border-top:2px solid transparent;border-right:2px solid transparent;border-bottom:2px solid transparent;border-left:2px solid transparent;}}@media all and (max-width: 1024px){.kt-accordion-id11084_a5a0b8-b9 > .kt-accordion-inner-wrap > .wp-block-kadence-pane > .kt-accordion-header-wrap > .kt-blocks-accordion-header{border-top:2px solid #f2f2f2;border-right:2px solid #f2f2f2;border-bottom:2px solid #f2f2f2;border-left:2px solid #f2f2f2;}}@media all and (max-width: 1024px){.kt-accordion-id11084_a5a0b8-b9 > .kt-accordion-inner-wrap > .wp-block-kadence-pane > .kt-accordion-header-wrap > .kt-blocks-accordion-header:hover, \n\t\t\t\tbody:not(.hide-focus-outline) .kt-accordion-id11084_a5a0b8-b9 .kt-blocks-accordion-header:focus-visible{border-top:2px solid #eeeeee;border-right:2px solid #eeeeee;border-bottom:2px solid #eeeeee;border-left:2px solid #eeeeee;}}@media all and (max-width: 1024px){.kt-accordion-id11084_a5a0b8-b9 .kt-accordion-header-wrap .kt-blocks-accordion-header:focus-visible,\n\t\t\t\t.kt-accordion-id11084_a5a0b8-b9 > .kt-accordion-inner-wrap > .wp-block-kadence-pane > .kt-accordion-header-wrap > .kt-blocks-accordion-header.kt-accordion-panel-active{border-top:2px solid var(--global-palette6, #718096);border-right:2px solid var(--global-palette6, #718096);border-bottom:2px solid var(--global-palette6, #718096);border-left:2px solid var(--global-palette6, #718096);}}@media all and (max-width: 767px){.kt-accordion-id11084_a5a0b8-b9 .kt-accordion-inner-wrap{display:block;}.kt-accordion-id11084_a5a0b8-b9 .kt-accordion-inner-wrap .kt-accordion-pane:not(:first-child){margin-top:1px;}.kt-accordion-id11084_a5a0b8-b9 .kt-accordion-panel-inner{border-top:2px solid transparent;border-right:2px solid transparent;border-bottom:2px solid transparent;border-left:2px solid transparent;}.kt-accordion-id11084_a5a0b8-b9 > .kt-accordion-inner-wrap > .wp-block-kadence-pane > .kt-accordion-header-wrap > .kt-blocks-accordion-header{border-top:2px solid #f2f2f2;border-right:2px solid #f2f2f2;border-bottom:2px solid #f2f2f2;border-left:2px solid #f2f2f2;}.kt-accordion-id11084_a5a0b8-b9 > .kt-accordion-inner-wrap > .wp-block-kadence-pane > .kt-accordion-header-wrap > .kt-blocks-accordion-header:hover, \n\t\t\t\tbody:not(.hide-focus-outline) .kt-accordion-id11084_a5a0b8-b9 .kt-blocks-accordion-header:focus-visible{border-top:2px solid #eeeeee;border-right:2px solid #eeeeee;border-bottom:2px solid #eeeeee;border-left:2px solid #eeeeee;}.kt-accordion-id11084_a5a0b8-b9 .kt-accordion-header-wrap .kt-blocks-accordion-header:focus-visible,\n\t\t\t\t.kt-accordion-id11084_a5a0b8-b9 > .kt-accordion-inner-wrap > .wp-block-kadence-pane > .kt-accordion-header-wrap > .kt-blocks-accordion-header.kt-accordion-panel-active{border-top:2px solid var(--global-palette6, #718096);border-right:2px solid var(--global-palette6, #718096);border-bottom:2px solid var(--global-palette6, #718096);border-left:2px solid var(--global-palette6, #718096);}}<\/style>\n<div class=\"wp-block-kadence-accordion alignnone\"><div class=\"kt-accordion-wrap kt-accordion-id11084_a5a0b8-b9 kt-accordion-has-3-panes kt-active-pane-0 kt-accordion-block kt-pane-header-alignment-left kt-accodion-icon-style-arrow kt-accodion-icon-side-left\" style=\"max-width:none\"><div class=\"kt-accordion-inner-wrap\" data-allow-multiple-open=\"false\" data-start-open=\"none\">\n<div class=\"wp-block-kadence-pane kt-accordion-pane kt-accordion-pane-2 kt-pane11084_f1d022-f1\"><div class=\"kt-accordion-header-wrap\"><button class=\"kt-blocks-accordion-header kt-acccordion-button-label-show\" type=\"button\"><span class=\"kt-blocks-accordion-title-wrap\"><span class=\"kt-blocks-accordion-title\"><code><code>Log_AddMsg<\/code> <\/code><strong>\u2014 Configure a log message<\/strong><\/span><\/span><span class=\"kt-blocks-accordion-icon-trigger\"><\/span><\/button><\/div><div class=\"kt-accordion-panel kt-accordion-panel-hidden\"><div class=\"kt-accordion-panel-inner\"><pre class=\"wp-block-code\" aria-describedby=\"shcb-language-1\" data-shcb-language-name=\"C++\" data-shcb-language-slug=\"cpp\"><span><code class=\"hljs language-cpp shcb-wrap-lines\"><span class=\"hljs-function\"><span class=\"hljs-keyword\">int<\/span>  <span class=\"hljs-title\">Log_AddMsg<\/span><span class=\"hljs-params\">(<span class=\"hljs-keyword\">int<\/span> msg_id, <span class=\"hljs-keyword\">int<\/span> sev, <span class=\"hljs-keyword\">const<\/span> <span class=\"hljs-keyword\">char<\/span> *msg)<\/span><\/span>;<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-1\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">C++<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">cpp<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>Configures a log message that can then be sent using <code>Log_SendMsg<\/code>. <\/p>\n\n\n\n<p>Can only be called in UserInit().<\/p>\n\n\n\n<p><strong>Parameters<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>msg_id<\/code>: a unique identifier for the message. It must begin at 0 and count up in order, ensuring no numbers are skipped.<\/li>\n\n\n\n<li><code>sev<\/code>: the message severity (10: Info, 20: Warning, 30: Error)<\/li>\n\n\n\n<li><code>msg<\/code>: the message that will be displayed in Cockpit<\/li>\n<\/ul>\n<\/div><\/div><\/div>\n\n\n\n<div class=\"wp-block-kadence-pane kt-accordion-pane kt-accordion-pane-3 kt-pane11084_d27c38-1e\"><div class=\"kt-accordion-header-wrap\"><button class=\"kt-blocks-accordion-header kt-acccordion-button-label-show\" type=\"button\"><span class=\"kt-blocks-accordion-title-wrap\"><span class=\"kt-blocks-accordion-title\"><code><code>Log_SendMsg<\/code> <\/code><strong>\u2014 Send a log message<\/strong><\/span><\/span><span class=\"kt-blocks-accordion-icon-trigger\"><\/span><\/button><\/div><div class=\"kt-accordion-panel kt-accordion-panel-hidden\"><div class=\"kt-accordion-panel-inner\"><pre class=\"wp-block-code\" aria-describedby=\"shcb-language-2\" data-shcb-language-name=\"C++\" data-shcb-language-slug=\"cpp\"><span><code class=\"hljs language-cpp shcb-wrap-lines\">Log_SendMsg(<span class=\"hljs-keyword\">int<\/span> msg_id, <span class=\"hljs-keyword\">float<\/span> vars&#91;]=<span class=\"hljs-literal\">nullptr<\/span>, <span class=\"hljs-keyword\">int<\/span> n_vars=<span class=\"hljs-number\">0<\/span>);<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-2\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">C++<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">cpp<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>Displays the message in the Cockpit log module.<\/p>\n\n\n\n<p>Can only be called in the interrupt routine.<\/p>\n\n\n\n<p><strong>Parameters<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>msg_id<\/code>: the message unique identifier<\/li>\n\n\n\n<li><code>vars<\/code>: an array of floating-point values that are inserted into the message<\/li>\n\n\n\n<li><code>n_vars<\/code>: the number of values to insert into the message<\/li>\n<\/ul>\n<\/div><\/div><\/div>\n<\/div><\/div><\/div>\n\n\n\n<div class=\"wp-block-simple-alerts-for-gutenberg-alert-boxes sab-alert sab-alert-warning\" role=\"alert\">If the Log_SendMsg() function is called directly in the UserInterrupt it will spam thousands of messages per second! The user should make sure to implement a trigger mechanism, using a boolean for instance as shown in the example below.<\/div>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-example-of-use\"><strong>Example of use<\/strong><\/h3>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-3\" data-shcb-language-name=\"C++\" data-shcb-language-slug=\"cpp\"><span><code class=\"hljs language-cpp shcb-code-table shcb-line-numbers\"><span class='shcb-loc'><span><span class=\"hljs-function\">tUserSafe <span class=\"hljs-title\">UserInit<\/span><span class=\"hljs-params\">(<span class=\"hljs-keyword\">void<\/span>)<\/span><\/span>\n<\/span><\/span><span class='shcb-loc'><span><span class=\"hljs-function\"><span class=\"hljs-params\"><\/span>{<\/span>\n<\/span><\/span><span class='shcb-loc'><span><span class=\"hljs-function\">    <span class=\"hljs-comment\">\/\/...<\/span><\/span>\n<\/span><\/span><span class='shcb-loc'><span><span class=\"hljs-function\">    <span class=\"hljs-comment\">\/\/ Configure a warning message with a unique id of 0<\/span><\/span>\n<\/span><\/span><span class='shcb-loc'><span><span class=\"hljs-function\">    Log_AddMsg(<span class=\"hljs-number\">0<\/span>, <span class=\"hljs-number\">20<\/span>, <span class=\"hljs-string\">\"Operating limits exceeded (V=%.3fV \/ I=%.3fA)\"<\/span>);<\/span>\n<\/span><\/span><span class='shcb-loc'><span><span class=\"hljs-function\">    <span class=\"hljs-comment\">\/\/...<\/span><\/span>\n<\/span><\/span><span class='shcb-loc'><span><span class=\"hljs-function\">    <span class=\"hljs-keyword\">return<\/span> SAFE;<\/span>\n<\/span><\/span><span class='shcb-loc'><span><span class=\"hljs-function\">}<\/span>\n<\/span><\/span><span class='shcb-loc'><span><span class=\"hljs-function\"><\/span>\n<\/span><\/span><span class='shcb-loc'><span><span class=\"hljs-function\"><span class=\"hljs-function\">tUserSafe <span class=\"hljs-title\">UserInterrupt<\/span><span class=\"hljs-params\">(<span class=\"hljs-keyword\">void<\/span>)<\/span><\/span><\/span>\n<\/span><\/span><span class='shcb-loc'><span><span class=\"hljs-function\"><span class=\"hljs-function\"><span class=\"hljs-params\"><\/span>{<\/span><\/span>\n<\/span><\/span><span class='shcb-loc'><span><span class=\"hljs-function\"><span class=\"hljs-function\">    <span class=\"hljs-comment\">\/\/...<\/span><\/span><\/span>\n<\/span><\/span><span class='shcb-loc'><span><span class=\"hljs-function\"><span class=\"hljs-function\"><\/span><\/span>\n<\/span><\/span><span class='shcb-loc'><span><span class=\"hljs-function\"><span class=\"hljs-function\">    <span class=\"hljs-keyword\">static<\/span> <span class=\"hljs-keyword\">bool<\/span> warning_message_sent = <span class=\"hljs-literal\">false<\/span>;<\/span><\/span>\n<\/span><\/span><span class='shcb-loc'><span><span class=\"hljs-function\"><span class=\"hljs-function\">    <span class=\"hljs-keyword\">if<\/span>(V_meas &gt; <span class=\"hljs-number\">850<\/span> || I_meas &gt; <span class=\"hljs-number\">40<\/span>){<\/span><\/span>\n<\/span><\/span><span class='shcb-loc'><span><span class=\"hljs-function\"><span class=\"hljs-function\">        <span class=\"hljs-keyword\">float<\/span> log_values&#91;<span class=\"hljs-number\">2<\/span>];<\/span><\/span>\n<\/span><\/span><span class='shcb-loc'><span><span class=\"hljs-function\"><span class=\"hljs-function\">        log_values&#91;<span class=\"hljs-number\">0<\/span>] = V_meas;<\/span><\/span>\n<\/span><\/span><span class='shcb-loc'><span><span class=\"hljs-function\"><span class=\"hljs-function\">        log_values&#91;<span class=\"hljs-number\">1<\/span>] = I_meas;<\/span><\/span>\n<\/span><\/span><span class='shcb-loc'><span><span class=\"hljs-function\"><span class=\"hljs-function\">        <span class=\"hljs-comment\">\/\/ Display the message in Cockpit<\/span><\/span><\/span>\n<\/span><\/span><span class='shcb-loc'><span><span class=\"hljs-function\"><span class=\"hljs-function\">        <span class=\"hljs-keyword\">if<\/span>(!warning_message_sent) {<\/span><\/span>\n<\/span><\/span><span class='shcb-loc'><span><span class=\"hljs-function\"><span class=\"hljs-function\">            Log_SendMsg(<span class=\"hljs-number\">0<\/span>, log_values, <span class=\"hljs-number\">2<\/span>);<\/span><\/span>\n<\/span><\/span><span class='shcb-loc'><span><span class=\"hljs-function\"><span class=\"hljs-function\">            warning_message_sent = <span class=\"hljs-literal\">true<\/span>;<\/span><\/span>\n<\/span><\/span><span class='shcb-loc'><span><span class=\"hljs-function\"><span class=\"hljs-function\">        }<\/span><\/span>\n<\/span><\/span><span class='shcb-loc'><span><span class=\"hljs-function\"><span class=\"hljs-function\">    } <span class=\"hljs-keyword\">else<\/span> {<\/span><\/span>\n<\/span><\/span><span class='shcb-loc'><span><span class=\"hljs-function\"><span class=\"hljs-function\">        warning_message_sent= <span class=\"hljs-literal\">false<\/span>;<\/span><\/span>\n<\/span><\/span><span class='shcb-loc'><span><span class=\"hljs-function\"><span class=\"hljs-function\">    }<\/span><\/span>\n<\/span><\/span><span class='shcb-loc'><span><span class=\"hljs-function\"><span class=\"hljs-function\"><\/span><\/span>\n<\/span><\/span><span class='shcb-loc'><span><span class=\"hljs-function\"><span class=\"hljs-function\">    <span class=\"hljs-comment\">\/\/...<\/span><\/span><\/span>\n<\/span><\/span><span class='shcb-loc'><span><span class=\"hljs-function\"><span class=\"hljs-function\"><\/span><\/span>\n<\/span><\/span><span class='shcb-loc'><span><span class=\"hljs-function\"><span class=\"hljs-function\">    <span class=\"hljs-keyword\">return<\/span> SAFE;<\/span><\/span>\n<\/span><\/span><span class='shcb-loc'><span><span class=\"hljs-function\"><span class=\"hljs-function\">}<\/span><\/span>\n<\/span><\/span><span class='shcb-loc'><span><span class=\"hljs-function\"><span class=\"hljs-function\"><\/span><\/span>\n<\/span><\/span><\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-3\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">C++<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">cpp<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>","protected":false},"excerpt":{"rendered":"<p>This block writes a user-defined message in the log module of Cockpit. Numerical values can be inserted into the message using the conversion specifier &#8220;%f&#8220;,&#8230;<\/p>\n","protected":false},"author":2,"featured_media":33315,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_kad_post_transparent":"","_kad_post_title":"","_kad_post_layout":"","_kad_post_sidebar_id":"","_kad_post_content_style":"","_kad_post_vertical_padding":"","_kad_post_feature":"","_kad_post_feature_position":"","_kad_post_header":false,"_kad_post_footer":false,"_kad_post_classname":"","footnotes":""},"categories":[16],"tags":[],"software-environments":[105,103,104],"provided-results":[],"related-products":[50,31,32,92,166,51,110],"guidedreadings":[],"tutorials":[],"user-manuals":[],"coauthors":[63],"class_list":["post-11084","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-software","software-environments-c-plus-plus","software-environments-matlab","software-environments-plecs","related-products-acg-sdk","related-products-b-board-pro","related-products-b-box-rcp","related-products-b-box-micro","related-products-b-box-rcp-3-0","related-products-cpp-sdk","related-products-tpi"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>LOG - Write a log message - Simulink, PLECS and C++ documentation<\/title>\n<meta name=\"description\" content=\"This page is the documentation of the Log block from imperix libraries that writes log messages in Cockpit log module.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/imperix.com\/doc\/software\/log-message\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"LOG - Write a log message - Simulink, PLECS and C++ documentation\" \/>\n<meta property=\"og:description\" content=\"This page is the documentation of the Log block from imperix libraries that writes log messages in Cockpit log module.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/imperix.com\/doc\/software\/log-message\" \/>\n<meta property=\"og:site_name\" content=\"imperix\" \/>\n<meta property=\"article:published_time\" content=\"2022-04-06T07:03:36+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-02-26T10:55:03+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/imperix.com\/doc\/wp-content\/uploads\/2025\/05\/software.png\" \/>\n\t<meta property=\"og:image:width\" content=\"500\" \/>\n\t<meta property=\"og:image:height\" content=\"334\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Julien Orsinger\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Julien Orsinger\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/imperix.com\\\/doc\\\/software\\\/log-message#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/imperix.com\\\/doc\\\/software\\\/log-message\"},\"author\":{\"name\":\"Julien Orsinger\",\"@id\":\"https:\\\/\\\/imperix.com\\\/doc\\\/#\\\/schema\\\/person\\\/65ef663818eab76f53cc627ab80e0a51\"},\"headline\":\"LOG &#8211; Write a log message\",\"datePublished\":\"2022-04-06T07:03:36+00:00\",\"dateModified\":\"2026-02-26T10:55:03+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/imperix.com\\\/doc\\\/software\\\/log-message\"},\"wordCount\":644,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/imperix.com\\\/doc\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/imperix.com\\\/doc\\\/software\\\/log-message#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/imperix.com\\\/doc\\\/wp-content\\\/uploads\\\/2025\\\/05\\\/software.png\",\"articleSection\":[\"Software reference\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/imperix.com\\\/doc\\\/software\\\/log-message#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/imperix.com\\\/doc\\\/software\\\/log-message\",\"url\":\"https:\\\/\\\/imperix.com\\\/doc\\\/software\\\/log-message\",\"name\":\"LOG - Write a log message - Simulink, PLECS and C++ documentation\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/imperix.com\\\/doc\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/imperix.com\\\/doc\\\/software\\\/log-message#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/imperix.com\\\/doc\\\/software\\\/log-message#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/imperix.com\\\/doc\\\/wp-content\\\/uploads\\\/2025\\\/05\\\/software.png\",\"datePublished\":\"2022-04-06T07:03:36+00:00\",\"dateModified\":\"2026-02-26T10:55:03+00:00\",\"description\":\"This page is the documentation of the Log block from imperix libraries that writes log messages in Cockpit log module.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/imperix.com\\\/doc\\\/software\\\/log-message#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/imperix.com\\\/doc\\\/software\\\/log-message\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/imperix.com\\\/doc\\\/software\\\/log-message#primaryimage\",\"url\":\"https:\\\/\\\/imperix.com\\\/doc\\\/wp-content\\\/uploads\\\/2025\\\/05\\\/software.png\",\"contentUrl\":\"https:\\\/\\\/imperix.com\\\/doc\\\/wp-content\\\/uploads\\\/2025\\\/05\\\/software.png\",\"width\":500,\"height\":334},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/imperix.com\\\/doc\\\/software\\\/log-message#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Knowledge base\",\"item\":\"https:\\\/\\\/imperix.com\\\/doc\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Software reference\",\"item\":\"https:\\\/\\\/imperix.com\\\/doc\\\/category\\\/software\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"LOG &#8211; Write a log message\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/imperix.com\\\/doc\\\/#website\",\"url\":\"https:\\\/\\\/imperix.com\\\/doc\\\/\",\"name\":\"imperix\",\"description\":\"power electronics\",\"publisher\":{\"@id\":\"https:\\\/\\\/imperix.com\\\/doc\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/imperix.com\\\/doc\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/imperix.com\\\/doc\\\/#organization\",\"name\":\"imperix\",\"url\":\"https:\\\/\\\/imperix.com\\\/doc\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/imperix.com\\\/doc\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/imperix.com\\\/doc\\\/wp-content\\\/uploads\\\/2021\\\/03\\\/imperix_logo.png\",\"contentUrl\":\"https:\\\/\\\/imperix.com\\\/doc\\\/wp-content\\\/uploads\\\/2021\\\/03\\\/imperix_logo.png\",\"width\":350,\"height\":120,\"caption\":\"imperix\"},\"image\":{\"@id\":\"https:\\\/\\\/imperix.com\\\/doc\\\/#\\\/schema\\\/logo\\\/image\\\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/imperix.com\\\/doc\\\/#\\\/schema\\\/person\\\/65ef663818eab76f53cc627ab80e0a51\",\"name\":\"Julien Orsinger\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/0a0328b09c6abe61fa1e263a1066dcb26ea8f3b9e8b1d78056047620947bb388?s=96&d=mm&r=g6545a7220411572e799ad58574cce259\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/0a0328b09c6abe61fa1e263a1066dcb26ea8f3b9e8b1d78056047620947bb388?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/0a0328b09c6abe61fa1e263a1066dcb26ea8f3b9e8b1d78056047620947bb388?s=96&d=mm&r=g\",\"caption\":\"Julien Orsinger\"},\"description\":\"Julien is a senior power electronics engineer. On the knowledge base, he is acting as the editorial manager and is therefore the co-author of numerous articles on a broad variety of topics.\",\"sameAs\":[\"https:\\\/\\\/www.linkedin.com\\\/in\\\/julien-orsinger-640ab2129\\\/\"],\"url\":\"https:\\\/\\\/imperix.com\\\/doc\\\/author\\\/orsinger\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"LOG - Write a log message - Simulink, PLECS and C++ documentation","description":"This page is the documentation of the Log block from imperix libraries that writes log messages in Cockpit log module.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/imperix.com\/doc\/software\/log-message","og_locale":"en_US","og_type":"article","og_title":"LOG - Write a log message - Simulink, PLECS and C++ documentation","og_description":"This page is the documentation of the Log block from imperix libraries that writes log messages in Cockpit log module.","og_url":"https:\/\/imperix.com\/doc\/software\/log-message","og_site_name":"imperix","article_published_time":"2022-04-06T07:03:36+00:00","article_modified_time":"2026-02-26T10:55:03+00:00","og_image":[{"width":500,"height":334,"url":"https:\/\/imperix.com\/doc\/wp-content\/uploads\/2025\/05\/software.png","type":"image\/png"}],"author":"Julien Orsinger","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Julien Orsinger","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/imperix.com\/doc\/software\/log-message#article","isPartOf":{"@id":"https:\/\/imperix.com\/doc\/software\/log-message"},"author":{"name":"Julien Orsinger","@id":"https:\/\/imperix.com\/doc\/#\/schema\/person\/65ef663818eab76f53cc627ab80e0a51"},"headline":"LOG &#8211; Write a log message","datePublished":"2022-04-06T07:03:36+00:00","dateModified":"2026-02-26T10:55:03+00:00","mainEntityOfPage":{"@id":"https:\/\/imperix.com\/doc\/software\/log-message"},"wordCount":644,"commentCount":0,"publisher":{"@id":"https:\/\/imperix.com\/doc\/#organization"},"image":{"@id":"https:\/\/imperix.com\/doc\/software\/log-message#primaryimage"},"thumbnailUrl":"https:\/\/imperix.com\/doc\/wp-content\/uploads\/2025\/05\/software.png","articleSection":["Software reference"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/imperix.com\/doc\/software\/log-message#respond"]}]},{"@type":"WebPage","@id":"https:\/\/imperix.com\/doc\/software\/log-message","url":"https:\/\/imperix.com\/doc\/software\/log-message","name":"LOG - Write a log message - Simulink, PLECS and C++ documentation","isPartOf":{"@id":"https:\/\/imperix.com\/doc\/#website"},"primaryImageOfPage":{"@id":"https:\/\/imperix.com\/doc\/software\/log-message#primaryimage"},"image":{"@id":"https:\/\/imperix.com\/doc\/software\/log-message#primaryimage"},"thumbnailUrl":"https:\/\/imperix.com\/doc\/wp-content\/uploads\/2025\/05\/software.png","datePublished":"2022-04-06T07:03:36+00:00","dateModified":"2026-02-26T10:55:03+00:00","description":"This page is the documentation of the Log block from imperix libraries that writes log messages in Cockpit log module.","breadcrumb":{"@id":"https:\/\/imperix.com\/doc\/software\/log-message#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/imperix.com\/doc\/software\/log-message"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/imperix.com\/doc\/software\/log-message#primaryimage","url":"https:\/\/imperix.com\/doc\/wp-content\/uploads\/2025\/05\/software.png","contentUrl":"https:\/\/imperix.com\/doc\/wp-content\/uploads\/2025\/05\/software.png","width":500,"height":334},{"@type":"BreadcrumbList","@id":"https:\/\/imperix.com\/doc\/software\/log-message#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Knowledge base","item":"https:\/\/imperix.com\/doc\/"},{"@type":"ListItem","position":2,"name":"Software reference","item":"https:\/\/imperix.com\/doc\/category\/software"},{"@type":"ListItem","position":3,"name":"LOG &#8211; Write a log message"}]},{"@type":"WebSite","@id":"https:\/\/imperix.com\/doc\/#website","url":"https:\/\/imperix.com\/doc\/","name":"imperix","description":"power electronics","publisher":{"@id":"https:\/\/imperix.com\/doc\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/imperix.com\/doc\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/imperix.com\/doc\/#organization","name":"imperix","url":"https:\/\/imperix.com\/doc\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/imperix.com\/doc\/#\/schema\/logo\/image\/","url":"https:\/\/imperix.com\/doc\/wp-content\/uploads\/2021\/03\/imperix_logo.png","contentUrl":"https:\/\/imperix.com\/doc\/wp-content\/uploads\/2021\/03\/imperix_logo.png","width":350,"height":120,"caption":"imperix"},"image":{"@id":"https:\/\/imperix.com\/doc\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/imperix.com\/doc\/#\/schema\/person\/65ef663818eab76f53cc627ab80e0a51","name":"Julien Orsinger","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/0a0328b09c6abe61fa1e263a1066dcb26ea8f3b9e8b1d78056047620947bb388?s=96&d=mm&r=g6545a7220411572e799ad58574cce259","url":"https:\/\/secure.gravatar.com\/avatar\/0a0328b09c6abe61fa1e263a1066dcb26ea8f3b9e8b1d78056047620947bb388?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/0a0328b09c6abe61fa1e263a1066dcb26ea8f3b9e8b1d78056047620947bb388?s=96&d=mm&r=g","caption":"Julien Orsinger"},"description":"Julien is a senior power electronics engineer. On the knowledge base, he is acting as the editorial manager and is therefore the co-author of numerous articles on a broad variety of topics.","sameAs":["https:\/\/www.linkedin.com\/in\/julien-orsinger-640ab2129\/"],"url":"https:\/\/imperix.com\/doc\/author\/orsinger"}]}},"_links":{"self":[{"href":"https:\/\/imperix.com\/doc\/wp-json\/wp\/v2\/posts\/11084","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/imperix.com\/doc\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/imperix.com\/doc\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/imperix.com\/doc\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/imperix.com\/doc\/wp-json\/wp\/v2\/comments?post=11084"}],"version-history":[{"count":65,"href":"https:\/\/imperix.com\/doc\/wp-json\/wp\/v2\/posts\/11084\/revisions"}],"predecessor-version":[{"id":43287,"href":"https:\/\/imperix.com\/doc\/wp-json\/wp\/v2\/posts\/11084\/revisions\/43287"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/imperix.com\/doc\/wp-json\/wp\/v2\/media\/33315"}],"wp:attachment":[{"href":"https:\/\/imperix.com\/doc\/wp-json\/wp\/v2\/media?parent=11084"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/imperix.com\/doc\/wp-json\/wp\/v2\/categories?post=11084"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/imperix.com\/doc\/wp-json\/wp\/v2\/tags?post=11084"},{"taxonomy":"software-environments","embeddable":true,"href":"https:\/\/imperix.com\/doc\/wp-json\/wp\/v2\/software-environments?post=11084"},{"taxonomy":"provided-results","embeddable":true,"href":"https:\/\/imperix.com\/doc\/wp-json\/wp\/v2\/provided-results?post=11084"},{"taxonomy":"related-products","embeddable":true,"href":"https:\/\/imperix.com\/doc\/wp-json\/wp\/v2\/related-products?post=11084"},{"taxonomy":"guidedreadings","embeddable":true,"href":"https:\/\/imperix.com\/doc\/wp-json\/wp\/v2\/guidedreadings?post=11084"},{"taxonomy":"tutorials","embeddable":true,"href":"https:\/\/imperix.com\/doc\/wp-json\/wp\/v2\/tutorials?post=11084"},{"taxonomy":"user-manuals","embeddable":true,"href":"https:\/\/imperix.com\/doc\/wp-json\/wp\/v2\/user-manuals?post=11084"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/imperix.com\/doc\/wp-json\/wp\/v2\/coauthors?post=11084"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}