API reference
The public declarations of @chrismichaelps/pudu-lang-log 0.1.0.
PuduLangLog
Alignmenttype@Log.Alignment.Padding — the width and side of padding
Bindingtype@Log.Binding.Mode — how holes take their arguments
Entrytype@Log.Entry.Pair — one dictionary key and its value
Eventtype@Log.Event.Record — one log event as sinks receive it
Failuretype@Log.Failure.Error — an error value attached to an event
Formattertype@Log.Formatter.Text — renders an event as text
Hinttype@Log.Hint.Capture — how a hole captures its argument
Holetype@Log.Hole.Token — one property placeholder in a template
@Log.Hole.Token — one property placeholder in a template
@Log.Hole.Token — one property placeholder in a template
Leveltype@Log.Level.Scale — how much an event matters, least first
Every level, least severe first.
Propertytype@Log.Property.Named — a name bound to a captured value
Every rolling interval, longest first.
RollingIntervaltype@Log.RollingInterval.Period — how often a file sink starts afresh
@Log.Scalar.Atom — one indivisible captured value
@Log.Structure.Record — named properties under an optional type tag
Templatetype@Log.Template.Parsed — a message template and its tokens
Timestamptype@Log.Timestamp.Instant — a UTC moment and its observer's offset
Tokentype@Log.Token.Piece — literal text or a placeholder
Valuetype@Log.Value.Captured — a property value as the pipeline carries it
PuduLangLog.Bridge
The level of a standard line;
Silentlines are never formatted.A
Std.Loglogger whose lines become events of this logger:DebugthroughFatalkeep theirmeaning, the logger's name becomes
SourceContext, each field a text property, and the messagethe event's text with its braces escaped. The standard logger prints nothing itself; which lines
are kept is this logger's decision.
PuduLangLog.Clock
Clocktype@Log.Clock.Source — a function answering the current moment
A clock that always answers the same moment.
A clock that starts at a moment and advances by
stepmilliseconds on every reading.The system clock with the machine's current offset.
The system clock at offset zero.
PuduLangLog.Configuration
Configurationtype@Log.Configuration.Settings — every choice a pipeline is built from
Configuringtrait@Log.Configuration.Configuring — one decision changed per call
A configuration keeping
Informationand above, with no sinks, the default capture policy, adisabled self-log, and the system clock.
A configuration for a sub-logger: like
createbut keeping every level, since the parentalready decided which events arrive.
The pipeline the configuration describes.
PuduLangLog.Constants.Names
The output template of console sinks.
FILE_TEMPLATE: StrconstThe output template of file sinks.
SOURCE_CONTEXT: StrconstThe property naming the part of the program that wrote an event.
PuduLangLog.Context
Bookmarktype@Log.Context.Bookmark — the stack as it was before a push
An independent context holding the same enrichers, for work started on another thread.
Contexttype@Log.Context.Stack — enrichers pushed and not yet popped
An empty context. Give each thread of work its own, or a clone of its parent's.
The enricher that applies the context's properties, the most recent first, so an inner push
wins over an outer one of the same name.
Pushes an enricher and answers the bookmark that pops it.
Pushes a destructured property and answers the bookmark that pops it.
Pushes a property and answers the bookmark that pops it.
Empties the stack.
Puts the stack back as it was when the bookmark was taken.
Empties the stack until the bookmark is restored.
Runs an action with a property pushed, popping it afterwards.
PuduLangLog.Domain.Capture
The template's holes bound to the arguments. Numbered templates bind by position; others bind
left to right, and arguments beyond the holes are kept as
__0,__1, and so on by index.Boundtype@Log.Domain.Capture.Bound — the properties bound and any problems met
A value captured under a hint:
Stringifyrenders it to text,Destructurekeeps structures,and
Defaultkeeps scalars and collections but renders structures to text. Limits apply atevery depth.
A depth of ten, and no limit on text length or collection size.
Policytype@Log.Domain.Capture.Policy — limits and rules applied while capturing
Transformtype@Log.Domain.Capture.Transform — a replacement for structures of one tag
UNLIMITED: IntconstThe largest limit, standing for no limit.
PuduLangLog.Domain.Clef
The event a compact JSON object describes.
@tis required; without@mtthe message@mbecomes a template with its braces escaped; the level defaults to
Information; members namedwith a doubled
@@are properties named with one@.The event one line of compact JSON describes, or why it cannot be read.
PuduLangLog.Domain.Dates
The timestamp under a format: a standard one-letter format, a custom pattern, or none for
MM/dd/yyyy HH:mm:ss zzz.The duration under a format:
cor none for[-][d.]hh:mm:ss[.fffffff],gfor[-][d:]h:mm:ss[.FFFFFFF],Gfor[-]d:hh:mm:ss.fffffff, or a custom pattern ofd,h,m,s,f, andF.The timestamp in round-trip form,
2026-09-28T18:03:00.1230000+02:00.
PuduLangLog.Domain.Display
The pieces with spaces added to reach an alignment's width.
A failure as text:
Kind: message, its trace lines indented underat, and each cause after--->in turn.One hole rendered from the properties and padded to its alignment.
A value as JSON, styled by the kind of value it is.
The template rendered with the properties. A format containing
lwrites text values withoutquotes; one containing
jwrites values without their own format as JSON. A hole whoseproperty is missing keeps its raw text.
Piecetype@Log.Domain.Display.Piece — text with its style
The pieces' text joined without styles.
A scalar as display text under a format; text is quoted unless the format is
l.Styletype@Log.Domain.Display.Style — the role a piece of text plays
TYPE_TAG: StrconstThe type tag JSON renderings of messages and properties carry.
A value as display pieces. Sequence elements take the format; structure and dictionary members
render without one.
PuduLangLog.Domain.EventId
A 32-bit one-at-a-time hash of the template text: events from the same template share it.
The identifier as eight lower-case hexadecimal digits.
PuduLangLog.Domain.Json
Bytes as upper-case hexadecimal digits.
The text as a JSON string literal: quotes, backslashes, and control characters escaped.
A scalar as JSON: numbers bare, text and times quoted, and non-finite floats as quoted names.
A value as JSON. Structures become objects that carry their tag under
typeTagwhen one isnamed; dictionaries become objects keyed by their keys' text.
PuduLangLog.Domain.Levels
The level rendered under an output format: a case letter
u,w, ortfollowed by a widthof one or two digits, or a lone
uorw; any other format gives the full name.The level's full name, such as
Information.The level a name or number denotes, ignoring case and surrounding spaces.
Whether an event at
levelis at or aboveminimum.The level's position, from 0 for
Verboseto 5 forFatal.The more severe of two levels.
PuduLangLog.Domain.Masking
A structure of the tag without its listed members, or none for any other value; names compare
ignoring case.
A structure of the tag with its listed members replaced by the mask text, or none for any other
value; names compare ignoring case.
The value with every structure member and dictionary entry of a listed name, at any depth,
replaced by the mask text; names compare ignoring case.
The property with its value replaced by the mask text when its name is listed, and otherwise
with its listed members hidden.
The value with every match of the patterns inside its text, at any depth, replaced by the mask
text. Keys and other scalars are kept.
PuduLangLog.Domain.Numbers
Digitstype@Log.Domain.Numbers.Digits — a number as sign, digits, and exponent
The digits of an exact number:
0.d1d2… × 10^exponent, without leading or trailing zeros.Zero has no digits.
The digits of a float read through its shortest text, or
Nonefor infinities and NaN.The integer digits and exactly
placesfraction digits of a number rounded half away from zero.The exact number under a format, or
Nonewhen the format is not understood.The integer under a format, or
Nonewhen the format is not understood.The float under a format, or
Nonewhen the format is not understood. Infinities and NaNrender as their names under every format.
The float in its shortest round-trip form: fixed notation for decimal exponents from -4 to 14,
and
d.dddE+XXoutside them.
PuduLangLog.Domain.Output
NEW_LINE: StrconstThe line break the
NewLinehole writes.The event rendered through an output template.
Timestamp,UtcTimestamp,Level,Message,Exception,NewLine,Properties,TraceId, andSpanIdname parts of theevent; any other hole names a property and writes nothing when it is absent.
PuduLangLog.Domain.Padding
The text in upper case for format
u, lower case forw, and unchanged otherwise.The text padded with spaces to the alignment's width, on the right for a left alignment and on
the left otherwise; text already as wide is unchanged.
PuduLangLog.Domain.Parser
Whether a name can be given to a property: any text that is not blank.
The template the text denotes. Text that does not form a valid hole is kept as literal text, so
every string parses.
PuduLangLog.Domain.Properties
The value bound to a name.
Whether a name is bound.
The list with the name bound to the value, replacing an existing binding in place or adding
it at the end.
putIfAbsent: &Array[PuduLangLog.Property] -> Str -> PuduLangLog.Value -> Array[PuduLangLog.Property]fnThe list with the name bound to the value unless it is already bound.
The list without a binding for the name.
PuduLangLog.Domain.Recency
The least recent keys to retire so that at most
limitremain; a negative limit counts as zero.The keys with
keymoved to, or added at, the most recent end.
PuduLangLog.Domain.Rolling
The start of the period holding the moment, as the local clock's milliseconds; none for
Infinite.The file for the period holding the moment: the period's date and an optional
_NNNsequenceinserted before the path's extension.
The highest sequence among the files of one period, when any carries one.
A file name in the path's directory read back into its period and sequence, when it is one of
the path's rolled files.
The start of the period after the one holding the moment, as the local clock's milliseconds.
The date pattern a file name carries for an interval.
The names of files to delete: every file but the current one, newest first (by period, then
sequence, then name, a missing value counting as the oldest), after the first
count - 1ofthem, and any whose period started before
oldest.Rolledtype@Log.Domain.Rolling.Rolled — a file name read back into its period
PuduLangLog.Domain.Schedule
A schedule that waits
bufferingmilliseconds between batches and gives up on a batch onceretrying it would pass
retryLimitmilliseconds after its first failure.The schedule after a batch failed at
now, with whether to drop the batch and the queue.The wait before the next batch: the buffering time until two failures in a row, then a delay
doubling from at least five seconds up to one minute.
Statetype@Log.Domain.Schedule.State — failures since the last successful batch
The schedule after a batch was written.
Verdicttype@Log.Domain.Schedule.Verdict — what to do with a failed batch
PuduLangLog.Domain.Settings
A target's argument, its name ignoring case.
A count of zero or more from a setting's text.
A plan that decides nothing.
The setting key of an environment variable named
PREFIX__Section__Key, the prefix ignoringcase, or none for a variable outside the prefix.
Filtertype@Log.Domain.Settings.Filter — an expression that keeps or drops events
trueorfalsefrom a setting's text, ignoring case.The settings of JSON text under a top-level section, its name ignoring case; the whole document
when the section is empty. Objects nest with
:and lists by index.The rolling interval a setting's text names, ignoring case.
The sink argument naming the level switch that controls it.
The level a setting's text names.
Plantype@Log.Domain.Settings.Plan — every decision the settings make
The plan colon-separated keys describe, and every setting that is unknown, malformed, or names
a level switch never declared. Section and argument names ignore case; a later value for the
same key replaces an earlier one; numbered and named entries keep the order they first appear.
Readtype@Log.Domain.Settings.Read — a plan and the settings it could not use
A switch name without its leading
$, in lower case.Targettype@Log.Domain.Settings.Target — a named sink or enricher and its arguments
PuduLangLog.Domain.Sources
Whether a source context is the prefix or lies beneath it, with case significant.
Whether a source context is the prefix or lies beneath it,
App.WebcoveringApp.Web.Apibut not
App.Website, ignoring case.
PuduLangLog.Enricher
Applies enrichers in order.
Applies an enricher only to events at or above a level.
Applies an enricher only to events a level switch allows.
Adds a property computed from the event unless the event already has one of that name, keeping
structures when
destructureis set.Adds a property unless the event already has one of that name, keeping structures.
Enrichertype@Log.Enricher.Function — an event in, the enriched event out
An enricher from a function over events.
Adds a property unless the event already has one of that name; structures render to text.
Applies an enricher only to events the condition accepts.
PuduLangLog.Enrichers.Environment
The variable
environmentNamereads when not told otherwise.Adds
EnvironmentNamefrom a variable,Productionwhen it is unset or empty.environmentUserName: fn(PuduLangLog.Event, &PuduLangLog.Domain.Capture.Policy) -> PuduLangLog.EventfnAdds
EnvironmentUserName: theUSERorUSERNAMEvariable, read once.Adds a property named after an environment variable holding its value, read once; an unset
variable adds nothing.
Adds
FailureDetail, a structure of the event's failure —Kind,Message,Trace, andCauses— for sinks that store properties but not failure text.Adds
MachineName: theHOSTNAMEorCOMPUTERNAMEvariable, or thehostnamecommand's answer,read once.
Adds
ProcessId, read once from the parent of a short-lived shell.Adds
ProcessName, the command name of the running program, read once.
PuduLangLog.Enrichers.Masking
MASK: StrconstThe text that replaces a hidden value unless another is given.
Hides every match of the regular expressions inside property text at any depth and inside the
failure's message, or answers why an expression does not compile.
Hides the value of every property, structure member, and dictionary entry of a listed name at
any depth; names compare ignoring case.
Hides e-mail addresses, card numbers, and international bank account numbers.
PuduLangLog.Event
An event from its parts, with no failure, trace, or span.
The message: the template rendered with the event's properties.
The value of a property.
The source context, when the event carries one as text.
The event with a failure attached.
The event without a property.
The event with a property set, replacing any value it had.
The event with a property set unless it already has one of that name.
The event with a trace and span identifier.
PuduLangLog.Expressions
The expression the text denotes, or why it could not be read, including a call to an unknown
function.
Compiledtype@Log.Expressions.Compiled — a parsed expression and its text
An enricher adding a property whose value is the expression evaluated for each event, unless
the event already has the property or the expression is undefined for it.
The value of a compiled expression for an event, or none when it is undefined.
A predicate true for the events that make the expression the boolean
true, for filters,conditional sinks, and conditional enrichers.
A formatter writing each event through an expression template of holes
{expression:format}and the directives
#if,#else if,#else,#each … in …,#delimit, and#end.
PuduLangLog.Expressions.Evaluator
The value of an expression, or none when it is undefined.
Scopetype@Log.Expressions.Evaluator.Scope — the event, bound names, and the present moment
The within of an event with no bound names.
PuduLangLog.Expressions.Functions
A function applied to evaluated arguments. Any undefined argument makes the answer undefined,
except for
CoalesceandIsDefined;cimakes text comparisons ignore case.RestandInspectof a failure are answered by the evaluator.An element of a sequence by position, or a member of a structure or dictionary by name.
Whether a name, in lower case, is a function this library knows.
PuduLangLog.Expressions.Lexer
PuduLangLog.Expressions.Parser
The expression starting at a token, and the index after it; used by templates to read holes.
The expression the whole text denotes, or where and why it could not be read.
PuduLangLog.Expressions.Syntax
Every function an expression calls, by lower-case name.
Elementtype@Log.Expressions.Syntax.Element — an array item or a spread array
Expressiontype@Log.Expressions.Syntax.Expression — one node of an expression
Fieldtype@Log.Expressions.Syntax.Field — an object member or a spread object
Every name an expression reads, in order of first appearance, locals included.
Quantifiertype@Log.Expressions.Syntax.Quantifier — whether any or every element must match
PuduLangLog.Expressions.Template
PuduLangLog.Expressions.Values
A boolean value.
The order of two numbers under a comparison operator; undefined unless both are numbers.
A value's number, reading integers, floats, and decimals alike.
Whether two values are equal: numbers by value whatever their kind, text optionally ignoring
case, and sequences, structures, and dictionaries member by member.
The equality of two possibly undefined values; undefined when either is.
Whether a value is the boolean
true; nothing else counts as true.A value's elements when it is a sequence.
Whether text matches a pattern where
%stands for any run of characters and_for one;%%and__stand for the characters themselves.An exact number value at the smallest scale that keeps it, so
1 / 4is0.25.A value as text for
ToStringand templates: text as it is, and anything else as displayedunder the format.
A text value.
A value's text.
PuduLangLog.Failure
The failure with another failure recorded as its cause.
The failure as text:
Kind: message, its trace, and its causes.A failure from any error value: its kind is the given name and its message the value's text.
A failure of a kind with a message.
The failure with trace lines added, innermost call first.
PuduLangLog.Filter
Events every predicate accepts.
Events some predicate accepts.
Events at or above a level.
Keeps every event the predicate rejects.
Keeps only events the predicate accepts.
Filtertype@Log.Filter.Keep — whether an event continues
Events whose source context is the source or lies beneath it.
Events the predicate rejects.
Predicatetype@Log.Filter.Predicate — a yes or no about one event
Events that carry a failure.
Events that carry a property.
Events whose property equals a value.
Events whose property satisfies a test.
PuduLangLog.Formatting.Compact
A formatter writing each event as one line:
@t,@mt,@rfor formatted holes,@lunlessthe level is
Information,@x,@tr,@sp, and the properties, names starting with@doubled to
@@.A formatter like
compactthat writes the rendered message as@mand the template'sidentifier as
@iin place of the template and renderings.
PuduLangLog.Formatting.Json
The template only, each document ending in a line break.
A formatter writing each event as one JSON document of
Timestamp,Level,MessageTemplate,optionally
RenderedMessage,TraceId,SpanId,Exception,Properties, and theRenderingsof formatted holes grouped by property.Optionstype@Log.Formatting.Json.Options — message rendering and line ending
@Log.Formatting.Json.Options — message rendering and line ending
PuduLangLog.Formatting.Reader
Every event of newline-delimited compact JSON, skipping blank lines; the first unreadable line
fails the whole text and is named by its number, counting from one.
Every event of a file of newline-delimited compact JSON.
The event one line of compact JSON describes, as
Compact.compactorCompact.renderedwroteit, or why the line cannot be read.
PuduLangLog.Formatting.Text
A formatter writing each event through an output template, parsed once.
PuduLangLog.LevelSwitch
Whether an event at a level passes the switch.
A switch starting at a level.
The switch's level.
LevelSwitchtype@Log.LevelSwitch.Shared — the level every holder of the switch sees
Registers a listener called with the old and new levels after every change.
Changes the level, calling each listener with the old and new levels when it differs.
PuduLangLog.Logger
The logger as a sink, so one pipeline can feed another. Events pass the logger's level check,
enrichers, and filters.
Flushes and closes every sink; call it once before the program ends.
Flushes every sink.
A logger over a pipeline.
Loggertype@Log.Logger.Handle — a pipeline seen through one context
Loggingtrait@Log.Logger.Logging — the operations of a logger
A logger that writes nothing.
The pipeline the logger currently writes through.
Replaces the pipeline of a reloadable logger, flushing and closing the previous one. Answers
whether the logger was reloadable.
A logger whose pipeline can be replaced with
reload; every logger derived from it follows.Roottype@Log.Logger.Root — a pipeline fixed at creation or replaceable later
PuduLangLog.Pipeline
Whether an event at a level from a source passes the pipeline's minimum: the override of the
most specific prefix covering the source decides when there is one.
Overridetype@Log.Pipeline.Override — a level switch for one source prefix
Pipelinetype@Log.Pipeline.Stages — levels, enrichment, filters, and sinks
The event enriched by the logger's own enrichers (most recent first) and the pipeline's, then
filtered, then emitted. The answer is an audit sink's failure, if any.
Reports problems met while binding a template to the self-log.
A pipeline that accepts no events.
The parsed template, from the store when it was parsed before. Up to a thousand templates of
at most 1024 characters are kept; others are parsed on every use.
An empty template store.
Templatestype@Log.Pipeline.Templates — parsed templates kept for reuse
PuduLangLog.SelfLog
A self-log that writes nothing until enabled.
Stops sending problems anywhere.
Starts sending problems to a writer.
Whether a writer is set.
SelfLogtype@Log.SelfLog.Channel — an optional writer for pipeline problems
A self-log writing to the error stream.
Writes a problem, prefixed with the UTC time, when a writer is set.
PuduLangLog.Settings
The base configuration changed by the settings, or every setting that could not be used. Keys
are colon-separated, section names ignore case, and sinks and enrichers are found by name in
the registry:
-
MinimumLevelorMinimumLevel:Default: the minimum level.-
MinimumLevel:ControlledBy: the level switch,$name, controlling the minimum.-
MinimumLevel:Override:Source: the level or level switch of a source prefix.-
LevelSwitches:$name: a level switch and its initial level.-
Properties:Name: a text property added to every event.-
Enrich:i(orEnrich:i:Name) andEnrich:i:Args:arg: a named enricher.-
WriteTo:i(orWriteTo:i:Name) andWriteTo:i:Args:arg: a named sink; the argumentsrestrictedToMinimumLevelandlevelSwitchapply to any sink.AuditTois the same foraudit sinks.
-
Filter:i:ByExcludingandFilter:i:ByIncludingOnly: a filter expression.-
Destructure:MaximumDepth,Destructure:MaximumStringLength,Destructure:MaximumCollectionCount, andDestructure:AsScalar:i: capture limits and tagscaptured as text.
An argument of a sink or enricher factory, its name ignoring case.
The settings of environment variables named
PREFIX__Section__Key, the prefix ignoring case:APP__MinimumLevel__Default=DebugsetsMinimumLevel:Default.The settings of a JSON document under a top-level section, such as
Log; the whole documentwhen the section is empty.
The settings of a JSON file under a top-level section.
Loadedtype@Log.Settings.Loaded — a configuration and the level switches it declared
The level switch the settings declared under a name, with or without its
$, to change thelevel while the program runs.
PuduLangLog.Settings.Registry
A registry naming nothing.
EnricherFactorytype@Log.Settings.Registry.EnricherFactory — an enricher built from its arguments
The enricher factory registered under a name, ignoring case.
Registeringtrait@Log.Settings.Registry.Registering — adding factories under names
Registrytype@Log.Settings.Registry.Catalog — factories by name
SinkFactorytype@Log.Settings.Registry.SinkFactory — a sink built from its arguments
The sink factory registered under a name, ignoring case.
A registry naming the sinks
Console,File, andHttp, and the enrichersMachineName,EnvironmentUserName,EnvironmentName,EnvironmentVariable,ProcessId,ProcessName, andFailureDetail.
PuduLangLog.Sink
A sink writing to every sink. A failing sink is reported to the self-log and the others still
receive the event, so the aggregate never fails.
A sink writing to every sink and answering the first failure after all have been tried, for
audit trails whose writes must be confirmed.
The sink receiving only events a condition accepts.
controlled: PuduLangLog.Sink.Sink -> &PuduLangLog.LevelSwitch.LevelSwitch -> PuduLangLog.Sink.SinkfnThe sink receiving only events a level switch allows.
FailureKindtype@Log.Sink.FailureKind — whether events of a failure may still arrive
A sink trying each sink in turn until one records the event. Events a sink loses later are
handed to the sinks after it. The chain fails only when every sink failed.
The sink with its failures reported to a listener instead of the caller. Failures a sink finds
later, such as a batch that could not be sent, reach the same listener.
A sink that formats each event and writes the text.
Listenertype@Log.Sink.Listener — receives reports of sink failures
A sink that discards every event.
A sink that writes each event with a function and needs no flushing or closing.
Reporttype@Log.Sink.Report — a sink failure and the events it lost
A listener writing each report to the self-log.
The sink receiving only events at or above a level.
Sinktype@Log.Sink.Destination — emits events, flushes, and closes
PuduLangLog.Sinks.Async
Asynctype@Log.Sinks.Async.Queue — a running wrapper and its counters
Ten thousand queued events, dropping new events when full, and a disabled self-log.
How many events were dropped because the queue was full.
Optionstype@Log.Sinks.Async.Options — queue size and behaviour when full
How many events wait in the queue.
The sink that queues events for the thread. Flushing waits until every accepted event was
written; closing also stops the thread.
Starts the thread that writes queued events to the inner sink.
PuduLangLog.Sinks.Batching
Batches of up to a thousand, every two seconds, the first event sent at once, a queue of a
hundred thousand, retries for up to ten minutes, and a disabled self-log.
Optionstype@Log.Sinks.Batching.Options — batch size, timing, queue, and retries
@Log.Sinks.Batching.Options — batch size, timing, queue, and retries
A sink queueing events for a worker thread that writes them to the target in batches. A failed
batch is retried with growing waits until the retry time runs out; events it loses are reported
to the self-log and to an attached listener. Flushing writes everything queued now.
Targettype@Log.Sinks.Batching.Target — where a batch of events is written
PuduLangLog.Sinks.Console
The console template, the literate theme when the terminal takes colour, and every event on
standard output.
Optionstype@Log.Sinks.Console.Options — layout, colours, and error stream
@Log.Sinks.Console.Options — layout, colours, and error stream
The text written for an event: the formatter's text when one is set, and otherwise the output
template, painted with the theme when colour is on.
A sink writing each event to standard output, or to standard error from the configured level.
Writes are serialized so lines from different threads never interleave.
Whether an event goes to the error stream.
PuduLangLog.Sinks.File
The file template, one file without rolling, a one-gibibyte limit, thirty-one retained files,
and unbuffered writes.
Optionstype@Log.Sinks.File.Options — path, layout, rolling, retention, and buffering
@Log.Sinks.File.Options — path, layout, rolling, retention, and buffering
A sink appending each event to the file of its period. A file that reached its size limit takes
no more events, or gives way to the next sequence when rolling on size; opening a file removes
the files retention no longer keeps. Buffered text is written on flush and close.
PuduLangLog.Sinks.Http
Compact JSON lines posted with the default batching and client limits.
@Log.Sinks.Http.Options — endpoint, headers, body format, batching, and transport
The request carrying a batch: every event formatted and joined, posted with the headers.
A batching sink posting each batch; a status outside 200 to 299 is a failed batch.
A transport sending requests with the standard client under limits, answering the status code.
Internal hosts must be named in the limits with
reaching.
PuduLangLog.Sinks.Map
A key function reading a property: text as it is, other values as displayed, and
fallbackwhen the event lacks the property.
Options routing by a key function and opening sinks with
create, keeping every sink open.Optionstype@Log.Sinks.Map.Options — the key of an event and the sink for a key
A sink handing each event to the sink of its key, opening that sink on first use. With a limit,
the least recently used sinks beyond it are flushed and closed, and reopened when their key
returns. Listeners attached to the map reach every sink it opens.
PuduLangLog.Sinks.Memory
A store keeping only the most recent
capacityevents.Forgets every event.
A store keeping every event.
The events received, oldest first.
The most recent event.
The events a predicate accepts.
Memorytype@Log.Sinks.Memory.Store — the events a memory sink has received
The rendered message of every event, oldest first.
The sink that adds events to the store.
The events written from a message template.
PuduLangLog.Sinks.Observable
How many observers are subscribed.
A subject with no observers.
Observabletype@Log.Sinks.Observable.Subject — the observers and whether the stream ended
An observer calling
nextfor each event and ignoring the end of the stream.Observertype@Log.Sinks.Observable.Observer — receives events and the end of the stream
The sink handing each event to every observer, in subscription order. Closing it ends the
stream: each observer's
completedruns once and the observers are removed.Adds an observer and answers the subscription that removes it. An observer added after the sink
closed is told at once that the stream ended.
Subscriptiontype@Log.Sinks.Observable.Subscription — the ticket that ends one subscription
Removes the observer of a subscription; removing it twice does nothing.
PuduLangLog.Sinks.Theme
Muted colours in the manner of a code editor.
Shades of grey only, with warnings and errors inverted.
Bright text on a dark terminal, with values coloured by kind: the default console theme.
A theme that writes no escape sequences.
The pieces joined, each styled piece wrapped in its escape sequence and a reset. Line breaks
stay outside the escapes so a terminal never carries colour onto the next line.
The sixteen basic colours, for terminals without a 256-colour palette.
Themetype@Log.Sinks.Theme.Palette — the escape sequence that starts each style
PuduLangLog.Timing
begin: &PuduLangLog.Logger.Logger -> Str -> Array[PuduLangLog.Value] -> PuduLangLog.Timing.OperationfnStarts timing an operation described by a template and its arguments. Nothing is written until
it is completed or abandoned.
Starts timing with a millisecond counter of the caller's choice, such as a test's.
Measuringtrait@Log.Timing.Measuring — how an operation ends and is reported
Operationtype@Log.Timing.Operation — a timed unit of work awaiting its outcome
Runs an action as a completed operation and answers its value.
Runs an action whose
Errabandons the operation with the error as its failure, and answers itsresult.
PuduLangLog.Value
A boolean value.
A byte-string value.
Capturabletrait@Log.Value.Capturable — a type that knows its captured form
An exact decimal value.
A dictionary keyed by text.
A duration value in milliseconds.
A float value.
An integer value.
The value as JSON.
A dictionary with scalar keys of any kind.
A sequence of values.
A moment value.
The null value.
A structure without a type tag.
Any capturable value in its captured form.
A named property.
The value as display text, the way a message shows it.
A structure with a type tag; destructure it with
@in a template to keep its shape.A text value.
PuduLangLog.Web.Correlation
The
x-correlation-idheader, theCorrelationIdproperty, the identifier echoed on theresponse, and random identifiers for requests that bring none.
An enrichment for request logging that adds the request's identifier to its completion event.
HEADER: StrconstThe header carrying the identifier unless another is chosen.
identifierOf: &Std.Http.Server.Route.Request -> &PuduLangLog.Web.Correlation.Options -> Option[Str]fnThe request's identifier: its header when present and not blank, and otherwise none.
The logger with the request's identifier as a property, for a handler's own events; the logger
unchanged when the request has none.
A middleware giving every request an identifier: the one its header brings, or a generated one
set on the request's header for the handlers after it. The response carries the identifier
when
echois set and the handler did not set the header itself.@Log.Web.Correlation.Options — the header, property, and identifier source
PROPERTY: StrconstThe property carrying the identifier unless another is chosen.
Thirty-two lower-case hexadecimal digits from a secure random source, or from the clock when no
such source is available.
PuduLangLog.Web.Diagnostic
Collectortype@Log.Web.Diagnostic.Collector — what a handler added to its request's completion event
An empty collector.
The entries set, oldest first.
Entrytype@Log.Web.Diagnostic.Entry — a value set by a handler and how to capture it
The failure set, if any.
Sets a property of the completion event, replacing an earlier value of the same name.
Sets a property of the completion event that keeps its structure.
Attaches a failure to the completion event.
PuduLangLog.Web.RequestLogging
The default message,
Errorfor a failure or a status of 500 and above andInformationotherwise, no extra enrichment, and the path without its query.
A handler given a collector for properties and a failure to add to its request's completion event.
Errorfor a failure or a status of 500 and above,Informationotherwise.MESSAGE: StrconstThe completion message of the defaults.
A middleware writing one event when each request completes.
@Log.Web.RequestLogging.Options — message, level, and properties of the event
SOURCE: StrconstThe source context of completion events.
RequestMethod,RequestPath,StatusCode, andElapsedin milliseconds.
