import type Transport from 'winston-transport'; import type { Format } from 'logform'; import type { Logger, LoggerFactory } from '@webpieces/core-util'; /** * WinstonFactoryBase - shared plumbing for the winston {@link LoggerFactory} * backends. Builds ONE underlying winston logger (a single `Console` transport, * handleExceptions/Rejections on) with the caller-chosen format stack, then hands * out a cached {@link WinstonLogger} per name (each a winston child carrying * `loggerName`). Subclasses differ only in the format stack they pass up. * * Neither `svcName` nor `version` is read here: BOTH are stamped per-record by * `RequestContext.buildStructuredLogFields` (the one map `injectContextFormat` already loops), so they * appear the moment `setInfo` runs — even if that is after this factory was constructed — and logging * works before it. This keeps winston and bunyan symmetrical: both read the same two ServiceInfo facts * from the same map, on every line. (svcName used to ride as construction-time `defaultMeta`, which * silently missed a `setInfo` that ran after the factory was built.) */ export declare abstract class WinstonFactoryBase implements LoggerFactory { private readonly base; private readonly loggers; /** * @param transport - the sink to write through. Defaults to a plain Console; the GCP subclass * passes a {@link ChunkingConsoleTransport} instead, because only there does a per-entry size * limit exist. Taking the whole transport (rather than a size knob) keeps the size limit a fact * about the SINK, which is where it actually lives — a dev terminal has no such limit. */ protected constructor(finalFormat: Format, transport?: Transport); getLogger(name: string): Logger; }