import { Logger } from "./Logger.js";
import createConsoleLogger from "./createConsoleLogger.js";
class SyncBailHook {
    call(_origin, _type, _args) {}
    constructor(_args){}
}
const currentDefaultLoggerOptions = {
    level: 'info',
    debug: false,
    console
};
let currentDefaultLogger = createConsoleLogger(currentDefaultLoggerOptions);
const configureDefaultLogger = (options)=>{
    Object.assign(currentDefaultLoggerOptions, options);
    currentDefaultLogger = createConsoleLogger(currentDefaultLoggerOptions);
};
const getLogger = (name)=>new Logger((type, args)=>{
        if (void 0 === hooks.log.call(name, type, args)) currentDefaultLogger(name, type, args);
    });
const hooks = {
    log: new SyncBailHook([
        'origin',
        'type',
        'args'
    ])
};
const logger = {
    getLogger: getLogger,
    configureDefaultLogger: configureDefaultLogger,
    hooks: hooks
};
export { logger };
