Skip to content

Modern Log LogEvent Write

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

Home › Logging › Logging › Sink.Write

Sink.Write

Writes one record to a sink; the method a sink of your own overrides.

Syntax

Write( r )

Examples

#import "std/logs"
using logs

'' Write is the Sink side, not the LogEvent side: every Sink implements
'' Write / Flush / Close / DroppedCount, and the Logger calls Write once
'' per record per sink.
dim con as ConsoleSink
dim lg as Logger
lg.AddSink( @con )

lg.Info( "routed to Write( )" )

'' Calling it directly is legal, and is what a custom sink overrides
dim r as LogRecord
r.level = LOG_INFO
r.message = "written directly"
con.Write( r )

Library: Logging
Category: Logging
Documented under: Members

Clone this wiki locally