import { configureLogger } from "./configure-logger";
import type { ILogger } from "./types";

let _loggerInstance: ILogger | null = null;

export const loggerSingleton = (): ILogger => {
  if (!_loggerInstance) {
    _loggerInstance = configureLogger("console"); // o desde process.env
  }
  return _loggerInstance;
};

export const setLoggerSingleton = (logger: ILogger): void => {
  _loggerInstance = logger;
};
