roarr

  • Version 7.12.0
  • Published
  • 87.1 kB
  • 6 dependencies
  • BSD-3-Clause license

Install

npm i roarr
yarn add roarr
pnpm add roarr

Overview

JSON logger for Node.js and browser.

Index

Variables

variable logLevels

const logLevels: {
debug: number;
error: number;
fatal: number;
info: number;
trace: number;
warn: number;
};

    variable Roarr

    const Roarr: Logger<JsonObject>;

      variable ROARR

      const ROARR: RoarrGlobalState;

        Functions

        function getLogLevelName

        getLogLevelName: (numericLogLevel: number) => LogLevelName;

          Type Aliases

          type Logger

          type Logger<Z = MessageContext> = LogMethod<Z> & {
          adopt: <T>(
          routine: () => T,
          context?: MessageContext | TransformMessageFunction<MessageContext>
          ) => Promise<T>;
          child: Child<Z>;
          debug: LogMethod<Z>;
          error: LogMethod<Z>;
          fatal: LogMethod<Z>;
          getContext: () => MessageContext;
          info: LogMethod<Z>;
          trace: LogMethod<Z>;
          warn: LogMethod<Z>;
          };

            type LogLevelName

            type LogLevelName = 'trace' | 'debug' | 'info' | 'error' | 'fatal' | 'warn';

              type LogWriter

              type LogWriter = (message: string) => void;

                type Message

                type Message<T = MessageContext> = {
                readonly context: T;
                readonly message: string;
                readonly sequence: string;
                readonly time: number;
                readonly version: string;
                };

                  type MessageEventHandler

                  type MessageEventHandler = (message: Message<MessageContext>) => void;

                    type MessageSerializer

                    type MessageSerializer = (message: Message<MessageContext>) => string;

                      type RoarrGlobalState

                      type RoarrGlobalState = {
                      asyncLocalStorage?: AsyncLocalStorage<AsyncLocalContext>;
                      sequence: number;
                      serializeMessage?: MessageSerializer;
                      versions: readonly string[];
                      write: LogWriter;
                      };

                        type TransformMessageFunction

                        type TransformMessageFunction<T> = (message: Message<T>) => Message<MessageContext>;

                          Package Files (4)

                          Dependencies (6)

                          Dev Dependencies (21)

                          Peer Dependencies (0)

                          No peer dependencies.

                          Badge

                          To add a badge like this onejsDocs.io badgeto your package's README, use the codes available below.

                          You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/roarr.

                          • Markdown
                            [![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/roarr)
                          • HTML
                            <a href="https://www.jsdocs.io/package/roarr"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>