renders a Lox' props - similar to what the console methods do, but with some improvements:
Several props are listed one after another, in the order they were passed. A log without props renders the empty string.
PropsPrinter.of(outputLox).print(true, {
depth: outputLox.module.slicedName.length + BoxFactory.getMarkerDepth(outputLox.box),
color: outputLox.module.color,
})
should the output be colored (with ANSI colors)
Optionalbox: { depth?: number; color?: string }
options for the box surrounding the printed props
Optionaldepth?: numberthe vertical depth, where the box starts / ends (typically the column of the log's box; capped at 200)
undefined the box will have a depth of 20 and is not connected to the
surrounding box layoutOptionalcolor?: stringcolor of the box and surrounding text (typically the color of the log's box)
undefined, the box will be greya pretty string of the props
StaticofThe static constructor of the PropsPrinter helper class. Use it for any OutputLox or
ErrorLox:
PropsPrinter.of(outputLox)
The printer is configured from the lox' own Lox.printProps - the configuration the call
chained onto Loxer.printProps(...). Whether to render at all stays the caller's decision:
lox.printProps is undefined for a log that did not ask for it.
to render the props of
a printer with a chained print(...) method
StaticofThe static constructor for values that belong to no log.
PropsPrinter.ofValues([payment, cart], { depth: 2 })
to render, listed one after another
Optionaloptions: PropsPrinterOptions
to configure the rendering
a printer with a chained print(...) method
StaticsingleRenders a single value onto exactly one line, whatever its size.
Loxer.log(payment) uses this for a non-primitive message: lox.message is a string, and a
line break in it would corrupt the box column.
to render
a one-line, uncolored rendering of the value
A helper class that renders the props of a
Loxinto a readable string.The built-in console output uses it for every log whose call chained
Loxer.printProps(...)/Loxer.pp(...). An output stream receives the raw lox inside its discriminated event and reaches the same rendering through PropsPrinter.of: