All files logger.ts

37.5% Statements 12/32
100% Branches 0/0
0% Functions 0/1
37.5% Lines 12/32

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 331x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x                                         1x  
 
export interface RPCLogOptions {
    severity: 'debug' | 'info' | 'warning' | 'error' | 'fatal';
}
 
export interface RPCLogger {
    log(message: string, options: RPCLogOptions);
}
 
export class RPCConsoleLogger implements RPCLogger {
    log(message: string, options: { severity: 'debug' | 'info' | 'warning' | 'error' | 'fatal'; }) {
        switch (options.severity) {
            case 'debug':
                console.debug(message);
                break;
            case 'info':
                console.info(message);
                break;
            case 'warning':
                console.warn(message);
                break;
            case 'error':
                console.error(message);
                break;
            case 'fatal':
                console.error(message);
                break;
            default:
                options.severity satisfies never;
        }
    }
}