Class GlobalLog

Hierarchy

  • GlobalLog

Constructors

  • Create the global logger, must setup oltp (http), console can be optionally setup and will just print logs.

    Parameters

    • __namedParameters: {
          console?: ConsoleArgs;
          otlp: OltpArgs;
      }
      • Optional console?: ConsoleArgs
      • otlp: OltpArgs

    Returns GlobalLog

Properties

console: null | ConsoleArgs
logger: Logger
loggerProvider: LoggerProvider
meterProvider: MeterProvider
oltp: OltpArgs
orig_console_fns: ConsoleFns
tracer: Tracer
tracerProvider: WebTracerProvider

Methods

  • Parameters

    • message: string
    • attrs: any[]

    Returns string

  • Parameters

    • severityText: LogLevel
    • message: string
    • Rest ...attrs: any[]

    Returns void

  • Log a debug message.

    Parameters

    • message: string
    • Rest ...attrs: any[]

    Returns void

  • Log an error message.

    Parameters

    • message: string
    • Rest ...attrs: any[]

    Returns void

  • Log an info message.

    Parameters

    • message: string
    • Rest ...attrs: any[]

    Returns void

  • Get a new Meter instance to record metrics with.

    Parameters

    • name: string
    • opts: MeterOptions | {
          version?: string;
      } = {}

    Returns Meter

    Example

    const meter = globalLog.getMeter("example-meter");
    const counter = meter.createCounter('metric_name');
    counter.add(10, { 'key': 'value' });
  • Log a warning message.

    Parameters

    • message: string
    • Rest ...attrs: any[]

    Returns void

  • Run a sync callback inside a span.

    Type Parameters

    • T

    Parameters

    • name: string
    • cb: ((span) => T)
        • (span): T
        • Parameters

          • span: any

          Returns T

    Returns T

  • Run an async callback inside a span.

    Type Parameters

    • T

    Parameters

    • name: string
    • cb: ((span) => Promise<T>)
        • (span): Promise<T>
        • Parameters

          • span: any

          Returns Promise<T>

    Returns Promise<T>

Generated using TypeDoc