init(label:factory:)

Construct a Logger given a label identifying the creator of the Logger or a non-standard LogHandler.

Logging.swift:916
init(label: String, factory: (String, Logger.MetadataProvider?) -> any LogHandler)

Parameters

label

An identifier for the creator of a Logger.

factory

A closure creating non-standard LogHandlers.

The label should identify the creator of the Logger. This can be an application, a sub-system, or even a datatype.

This initializer provides an escape hatch in case the global default logging backend implementation (set up using LoggingSystem.bootstrap is not appropriate for this particular logger.