Keeta LogoKeeta Logo@keetanetwork/keetanet-client
    Preparing search index...

    Implements

    Index

    Constructors

    Properties

    batchSize: number = 10

    The maximum number of log entries to send to each target at a time

    parent: null | Log = null

    Parent logger, if any -- used for creating hierarchical loggers

    ConsoleTarget: typeof LogTargetConsole = LogTargetConsole

    The Console target, which is a basic logging target that outputs logs to the console

    defaultLevel: LogTargetLevel = 'DEBUG'

    The default log level, used for new instances of the logger

    Accessors

    • get targets(): LogTarget[]

      Get the currently registered log targets.

      If this is a child logger, this will return the parent's targets because child loggers share the same targets as their parent.

      Returns LogTarget[]

    Methods

    • Dispose of the logger instance, syncing all logs, and clearing targets

      Returns Promise<void>

    • Dispose of the logger instance, clearing all logs and targets

      Returns void

    • Create a child logger instance that shares the same targets as this instance but has its own log queue, this is useful for creating hierarchical loggers which can call sync independently.

      Since the child shares the same targets, registering or unregistering targets from either the parent or child will affect both.

      Returns Log

    • Parameters

      • options: { currentRequestInfo?: LogCurrentRequest; userVisible?: boolean }
      • from: string
      • ...args: unknown[]

      Returns void

    • Parameters

      • from: string
      • ...args: unknown[]

      Returns void

    • Terminate the logger instance, clearing all logs and targets

      Returns void

    • Parameters

      • options: { currentRequestInfo?: LogCurrentRequest; userVisible?: boolean }
      • from: string
      • ...args: unknown[]

      Returns void

    • Parameters

      • from: string
      • ...args: unknown[]

      Returns void

    • Parameters

      • options: { currentRequestInfo?: LogCurrentRequest; userVisible?: boolean }
      • from: string
      • ...args: unknown[]

      Returns void

    • Parameters

      • from: string
      • ...args: unknown[]

      Returns void

    • Parameters

      • options: { currentRequestInfo?: LogCurrentRequest; userVisible?: boolean }
      • from: string
      • ...args: unknown[]

      Returns void

    • Parameters

      • from: string
      • ...args: unknown[]

      Returns void

    • Start a timer to periodically sync logs to all targets

      Parameters

      • rate: number = 100

      Returns void

    • If a timer was started with startAutoSync(), stop it

      Returns void

    • Sync all currently enqueued logs to all targets

      Returns Promise<void>

    • Unregister a logging target (sink) to stop sending logs to

      Parameters

      Returns void

    • Parameters

      • options: { currentRequestInfo?: LogCurrentRequest; userVisible?: boolean }
      • from: string
      • ...args: unknown[]

      Returns void

    • Parameters

      • from: string
      • ...args: unknown[]

      Returns void

    • The legacy logger

      This is a singleton instance of the logger that registers a console target that emits logs immediately to the console.

      This also sets the log level based on the <name>_DEBUG environment variable, if available and adds filtering based on the <name>_DEBUG_FILTER environment variable, if available.

      The default value for <name> is KEETANET.

      Parameters

      • name: string = 'KEETANET'

      Returns Log

    • The Null logger, to disable logging entirely

      Returns Logger