Trace.WriteLine
---------------

Adds line to trace logging.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [Trace](component_Trace.md) | [9.1](newinversion91.md) | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |

MBS( "Trace.WriteLine" { ; Parameters... } ) 

**MBS**( **"Trace.WriteLine";** /\* Adds line to trace logging. \*/  
**$Parameters...**) /\* Optional; The parameters to print to the trace line.  
Can be several parameters in various data types.e.g. "Hello" \*/ 

### Parameters

| Parameter | Description | Example | Flags |
|---|---|---|---|
| Parameters... | The parameters to print to the trace line.   Can be several parameters in various data types. | "Hello" | Optional |

### Result

Returns OK or error.

### Description

Adds line to trace logging.  
  
This function takes variable number of parameters. Pass as much parameters as needed separated by the semicolon in FileMaker.  
Please repeat Parameters parameter as often as you need.  
### Examples

Add trace log entry:

 MBS ("Trace.WriteLine"; "Hello: "; 123)  
Trace an export field contents error:

 Export Field Contents \[ Kontakte::Foto ; “$path ” ; Create folders: Off \]   
Set Variable \[ $r ; Value: Let ( \[  
 e = Get(LastError);  
 r = If( e ≠ 0; MBS ("Trace.WriteLine"; "Export all field contents: "; e); "")  
\]; r ) \]  
Log last error:

 Set Variable \[ $r ; Value: MBS ( "Trace.WriteLine"; "Lasterror: "; Get(LastError)) \]  
### Release notes

- **Version 9.1**
    - Added [Trace.WriteLine](http://www.mbsplugins.eu/TraceWriteLine.shtml) function to write text/data into trace logging.

### Blog Entries

- [Watching for Errors with MBS Plugin](https://www.mbsplugins.de/archive/2021-03-18/Watching_for_Errors_with_MBS_P/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 9.1pr3](https://www.mbsplugins.de/archive/2019-02-18/MBS_FileMaker_Plugin_version_9/monkeybreadsoftware_blog_filemaker)

This function is free to use.

Created 14th February 2019 , last changed 7th November 2024

  
[Trace.SetWithTimes](TraceSetWithTimes.md) - [Translation.Available](TranslationAvailable.md)

[HTML Version](TraceWriteLine.shtml)