Options
All
  • Public
  • Public/Protected
  • All
Menu

@jackdbd/tags-logger

A logger inspired by how logging is implemented in Hapi.js.

see

Logging - Hapi Tutorials

see

Structured Logging - Google Cloud Operations Suite

Index

Interfaces

Variables

Functions

Variables

statement: ObjectSchema<Statement> = ...

Joi schema to validate each log statement against.

remarks

Log statements are validated only when the option should_validate_log_statements is set to true.

Functions

  • makeLog(options?: Options): (<T>(stmt: T) => void)
  • Factory that returns a log function that will either print structured or unstructured log statements, with optional schema validation for each log statement in both cases.

    Each log statement you pass to the log function returned to this logger should have (and must have if you validate the log statements) a message and a tags array.

    Unstructured logging is delegated to the debug library. For example, if you set the environment variable DEBUG to DEBUG=app/*,-app/foo, the log function will print everything matching app/*, except app/foo.

    see

    Logging - Hapi Tutorials

    see

    Structured Logging - Google Cloud Operations Suite

    see

    debug logger - GitHub

    Parameters

    Returns (<T>(stmt: T) => void)

      • <T>(stmt: T): void

Generated using TypeDoc