Skip to content

Modern Log Info

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

Home › Logging › Logging › Info

Info

Logs a message at the info level, or returns a record to add fields to.

Syntax

Info( ) as LogEvent
Info( byref m as ustring )

Notes

  • The ordinary running commentary of a healthy program.
  • Two forms: the one taking a message logs immediately, and the no-argument one returns a LogEvent to hang fields on, committed by .Msg( ) or .Send( ).
  • An event that is never committed emits nothing -- the destructor does not auto-send, so a forgotten .Msg( ) shows up as a missing line rather than a line from nowhere.
  • Suppressed entirely when the logger's MinLevel is above LOG_INFO, and Enabled( ) is how to skip building an expensive message.

Examples

#import "std/logs"
using logs

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

lg.Info( "a message, logged immediately" )

'' Or build a record with fields, committed by Msg( )
lg.Info( ).AddText( "user", "ada" ).AddInt( "attempt", 2 ).Msg( "with fields" )

'' Nothing is emitted by an event that is never committed
lg.Info( ).AddText( "user", "grace" )
print "done"

Library: Logging
Category: Logging
Documented under: Members

Clone this wiki locally