"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.hookLogger = hookLogger;
let idCounter = 0;
function hookLogger(emitter, log, logCtx) {
    logCtx = `${logCtx}-${idCounter++}`;
    const { mongoLogId } = log;
    emitter.on('socks5:authentication-complete', (ev) => {
        log.info('DEVTOOLS-PROXY', mongoLogId(1_001_000_253), `socks5-${logCtx}`, 'Validated auth parameters', { ...ev });
    });
    emitter.on('socks5:skip-auth-setup', () => {
        log.info('DEVTOOLS-PROXY', mongoLogId(1_001_000_254), `socks5-${logCtx}`, 'Skipping auth setup');
    });
    emitter.on('socks5:start-listening', (ev) => {
        log.info('DEVTOOLS-PROXY', mongoLogId(1_001_000_255), `socks5-${logCtx}`, 'Listening for Socks5 connections', { ...ev });
    });
    emitter.on('socks5:forwarding-error', (ev) => {
        log.error('DEVTOOLS-PROXY', mongoLogId(1_001_000_259), `socks5-${logCtx}`, 'Failed to establish new outgoing connection from Socks5 proxy', { ...ev });
    });
    emitter.on('socks5:agent-initialized', () => {
        log.info('DEVTOOLS-PROXY', mongoLogId(1_001_000_259), `socks5-${logCtx}`, 'Finished initializing agent');
    });
    emitter.on('socks5:closing-tunnel', () => {
        log.info('DEVTOOLS-PROXY', mongoLogId(1_001_000_256), `socks5-${logCtx}`, 'Closing Socks5 tunnel');
    });
    emitter.on('socks5:got-forwarding-request', (ev) => {
        log.info('DEVTOOLS-PROXY', mongoLogId(1_001_000_260), `socks5-${logCtx}`, 'Received Socks5 fowarding request', { ...ev });
    });
    emitter.on('socks5:accepted-forwarding-request', (ev) => {
        log.info('DEVTOOLS-PROXY', mongoLogId(1_001_000_262), `socks5-${logCtx}`, 'Established outbound connection and accepting socks5 request', { ...ev });
    });
    emitter.on('socks5:failed-forwarding-request', (ev) => {
        log.error('DEVTOOLS-PROXY', mongoLogId(1_001_000_265), `socks5-${logCtx}`, 'Error establishing outbound connection for socks5 request', { ...ev });
    });
    emitter.on('socks5:forwarded-socket-closed', (ev) => {
        log.info('DEVTOOLS-PROXY', mongoLogId(1_001_000_264), `socks5-${logCtx}`, 'Socks5 stream socket closed', { ...ev });
    });
    emitter.on('ssh:client-closed', () => {
        log.info('DEVTOOLS-PROXY', mongoLogId(1_001_000_252), `ssh-${logCtx}`, 'sshClient closed');
    });
    emitter.on('ssh:establishing-conection', (ev) => {
        log.info('DEVTOOLS-PROXY', mongoLogId(1_001_000_257), `ssh-${logCtx}`, 'Establishing new SSH connection', { ...ev });
    });
    emitter.on('ssh:failed-connection', (ev) => {
        log.info('DEVTOOLS-PROXY', mongoLogId(1_001_000_258), `ssh-${logCtx}`, 'Failed to establish new SSH connection', { ...ev });
    });
    emitter.on('ssh:established-connection', () => {
        log.info('DEVTOOLS-PROXY', mongoLogId(1_001_000_259), `ssh-${logCtx}`, 'Finished establishing new SSH connection');
    });
    emitter.on('ssh:failed-forward', (ev) => {
        log.error('DEVTOOLS-PROXY', mongoLogId(1_001_000_261), `ssh-${logCtx}`, 'Error forwarding outbound SSH connection, potentially retrying', {
            ...ev,
        });
    });
}
//# sourceMappingURL=logging.js.map