Loxer - v3.0.0
    Preparing search index...

    Interface Modifiers<Delete>

    interface Modifiers<Delete extends string> {
        nc(
            doit?: boolean,
        ): LogMethods & Omit<Modifiers<Delete | nc>, Delete | nc>;
        noColumn(
            doit?: boolean,
        ): LogMethods & Omit<Modifiers<Delete | nc>, Delete | nc>;
        pp(
            options?: PropsPrinterOptions,
        ): LogMethods & Omit<Modifiers<Delete | pp>, Delete | pp>;
        printProps(
            options?: PropsPrinterOptions,
        ): LogMethods & Omit<Modifiers<Delete | pp>, Delete | pp>;
        h(doit?: boolean): LogMethods & Omit<Modifiers<Delete | h>, Delete | h>;
        highlight(
            doit?: boolean,
        ): LogMethods & Omit<Modifiers<Delete | h>, Delete | h>;
        m(moduleId?: string): LogMethods & Omit<Modifiers<Delete | m>, Delete | m>;
        module(
            moduleId?: string,
        ): LogMethods & Omit<Modifiers<Delete | m>, Delete | m>;
    }

    Type Parameters

    • Delete extends string
    Index
    •     const request = Loxer.m('HTTP').open('handleCheckout()'); // reserves a column
      const span = Loxer.m('SVC').noColumn().open('submit()'); // reserves none

      Loxer.of(span).add('total = 149.99');
      Loxer.of(span).close('done');

      Every open box reserves a vertical column in the box layout, and that column widens the box prefix of every other log for as long as the box stays open. That is the right trade for a box a reader follows - a request, a transaction, an async flow whose interleaving is the point. For a box that only marks an entry and an exit - a short wrapper span, one frame of a traced call stack - the columns carry nothing the open and close lines do not already say, and four nested spans push every log inside them four columns right.

      A box opened with this reserves no column, so the logs around it render the prefix they would render had it never been opened. It keeps everything else: its id, its module, its timing, its Loxer.of(id) reachability, its history entry and its level semantics. Its own open and close lines still carry their glyphs, so the flow's beginning and end stay visible.

      • the selection is captured on the box when it opens: every later Loxer.of(id) call on that box inherits it without chaining this again
      • it is a one-shot modifier like Modifiers.highlight and Modifiers.module: the next box reserves a column unless it chains this itself
      • a box opened inside one reserves its column at the depth it would have reached had the enclosing box never been opened
      • a module's threshold decides visibility exactly as it does for any other box - this drops, hides and re-levels nothing
      • boxLayoutStyle: 'off' is the opposite trade: it keeps the column's width and drops the glyphs
      • an output stream reads lox.columnFree to render such a box its own way

      Parameters

      • Optionaldoit: boolean

        should the box reserve no column

      Returns LogMethods & Omit<Modifiers<Delete | nc>, Delete | nc>

    •     Loxer.printProps().log('restoring order', payment)
      Loxer.printProps({ depth: 1 }).open('checkout', cart)
      Loxer.printProps().error(error, payment)

      Props are attached to every log that is called with them, and reach the output stream and the history whether or not this is chained. What it decides is whether the built-in console output renders them below the message, connected to the log's box column.

      • chaining it at all is the request: Loxer.printProps() and Loxer.printProps({}) render alike. The parameter carries formatting configuration, not the decision
      • a value is rendered whatever its truthiness, null and 0 included
      • it is a one-shot modifier like Modifiers.highlight and Modifiers.module: the next log renders nothing unless it chains this itself
      • a log without props renders no block
      • an output stream receives the raw lox inside its event and can render it with OutputLoxRenderer or PropsPrinter.of(lox).print(), reading lox.printProps to honor the request

      Parameters

      Returns LogMethods & Omit<Modifiers<Delete | pp>, Delete | pp>

    •     Loxer.highlight().log(...)
      Loxer.highlight().open(...)
      Loxer.highlight().of(...)
      Loxer.highlight().error(...)
      • the log's time field is marked with a background color — grey rgb(70, 70, 70) by default. The message keeps the color its severity gives it, so the two compose.
      • an output renderer can select a highlight color with LoxerOutputRendererOptions.colors
      • the parameter doit?: boolean can conditionally highlight the log with true
      • this function can be chained with any other chaining function like .module(...)
      • highlighting error logs does not color the message differently but append the stack to the default console output

      Parameters

      • Optionaldoit: boolean

        should the log be highlighted

      Returns LogMethods & Omit<Modifiers<Delete | h>, Delete | h>

    •     Loxer.module(string).log(...)
      Loxer.module(string).open(...)
      Loxer.module(string).of(...)
      • if you don't chain this function the module is always NONE, which will lead the log to not have the box layout
      • if you chain the function without a parameter like Loxer.module().log(...) the module will be DEFAULT, which will lead the log to have a box layout but no name
      • both of the default modules can be overwritten at LoxerOptions.modules declared in Loxer.init(options)
      • modules can be defined at LoxerOptions.modules declared in Loxer.init(options)
      • this function can be chained with any other chaining function like .highlight(...)
      • the accepted ids are string by default. Augment the LoxerModuleRegistry to have them autocompleted and typo-checked against the modules of your project

      Parameters

      • OptionalmoduleId: string

        the key of the module from LoxerOptions.modules. undefined defaults to module "DEFAULT"

      Returns LogMethods & Omit<Modifiers<Delete | m>, Delete | m>