Skip to content

Modern Log LogEvent AddText

Paul Squires edited this page Oct 19, 2026 · 2 revisions

Home › Logging › Logging › LogEvent.AddText

LogEvent.AddText

Adds a named text field to the record and returns the record for the next call.

Syntax

AddText( k, v as ustring )

Examples

#import "std/logs"
using logs

dim con as ConsoleSink
dim lg as Logger
lg.AddSink( @con )

lg.Info( ).AddText( "file", "data.csv" ).AddText( "mode", "read" ).Msg( "opened" )

'' Every field method returns BYREF to the same event, which is what
'' makes the chain work -- and the event lives on the CALLER'S STACK,
'' which is what makes it thread-safe with no thread-local storage

Library: Logging
Category: Logging
Documented under: Members

Clone this wiki locally