Skip to content

Modern Log LogEvent AddTime

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

Home › Logging › Logging › LogEvent.AddTime

LogEvent.AddTime

Adds a named field holding a point in time.

Syntax

AddTime( k, v as Instant )

Examples

#import "std/chrono"
#import "std/logs"
using logs, chrono


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

'' Instant has no Now( ) -- the clock lives in SystemClock; an Instant
'' is built from a count, here a Unix timestamp
dim as Instant at = Instant.FromUnixSeconds( 1767225600 )
lg.Info( ).AddTime( "at", at ).Msg( "stamped" )

Library: Logging
Category: Logging
Documented under: Members

Clone this wiki locally