---
title: LogMsg
slug: logmsg
docTags: 
createdAt: 2023-04-19T12:40:28.000Z
---

Logs message to a text file.

The file has to be specified prior by the [LogFile](docId\:O8uMNjPOxJ29-g_tKKAsN) command.

:::BlockQuote
LogMsg  "\<message text>"
:::

### Parameters

- message text parameter specifies the message to be displayed
  - if [variable](docId\:oqHjs3LLCfQkSac_cemc2) numbers are included outside of quotation marks, this results in the value of that variable being appended to the message e.g.&#x20;
    `Msg "value of variable 4000 is " #4000`
  - if `%t...`  is included outside of quotation marks, this results in the tool description of the tool number being appended to the message e.g.&#x20;
    `Msg "T1 is " %t1` or `msg "Current tool: " %t#5011`
  - if `%d`  is included outside of quotation marks, this results in the current date and time being appended to the message e.g. `Msg "Time: "%d` will output *Time: 2022-10-28 13:35:52*

### Example

:::BlockQuote
LogFile "text.txt" 1
LogMsg "Current position of X is "#5001
:::


Now check the contents of file text.txt will now contain&#x20;

Msg, LogMsg, WarnMsg, ErrMsg can now use %txx (xx = 0-99) and this will show the tool description text.&#x20;
Example: msg %t#5011 " is changed to "Tool number 5" this is text from the tool table.
