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.

  • Parameters

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