|
<< Click to Display Table of Contents >> Navigation: 3. Script Language > Internet and Network > MCP. - MCP (Model-Context Protocol) server operations > !Server-Operations - Commands for interacting with a running MCP server (signals, actions) > MCP. - MCP Server Operations |
SPR Script Language
HTP.MCPSetLogToConsole
Enables or disables logging to the console window.
Intention
The MCP server can output detailed log messages to a separate console window, which is useful for debugging. However, writing to the console can slow down execution. The HTP.MCPSetLogToConsole command gives you control over this feature.
You can disable console logging for maximum performance in a production script or enable it when you need to diagnose issues with the server's internal operations. This command does not affect the log messages displayed in the server's main GUI window.
Illustration
🔊 Volume Control: Think of this command as the volume knob for the server's console chatter.
🔈 State 0: Mute the console for quiet, fast operation.
🔊 State 1: Turn up the volume to hear all the debug messages.
Syntax
HTP.MCPSetLogToConsole|$$STATE
Parameter Explanation
P1 - $$STATE - (Numeric, Required)
A numeric value that determines the logging state. 1 enables console logging; 0 disables it. Any non-zero value is treated as 1.
Examples
'***********************************
' HTP.MCPSetLogToConsole - Sample 1: Disable Console Logging
'***********************************
' Disable console output for a cleaner run
HTP.MCPSetLogToConsole|0
MCP.Init
MCP.Start
MBX.Server started quietly.
MCP.Stop
ENR.
'
'***********************************
' HTP.MCPSetLogToConsole - Sample 2: Enable Console Logging
'***********************************
' Enable console output to see debug messages
HTP.MCPSetLogToConsole|1
MCP.Init
MCP.Start
MBX.Server started with console logging enabled.
MCP.Stop
ENR.
Remarks
- This command should ideally be called before MCP.Init to affect the initial startup messages.
- The command takes effect immediately for any subsequent log messages.
- This command does not return a value.
See also:
• MCP.Init