import BaseLogger from "./BaseLogger" ; import { LogSeverity } from "./LogSeverity" ; export class ConsoleLogger extends BaseLogger { logMessage ( severity , message ) { const timeString = this . getTimeString ( ) ; if ( typeof severity !== 'string' ) { severity = LogSeverity . toString ( severity ) ; } console . log ( `${ timeString } [${ severity }] ${ message }` ) ; } logException ( error ) { const timeString = this . getTimeString ( ) ; console . log ( `${ timeString } ${ error . message }` ) ; console . log ( `${ timeString } ${ error . stack }` ) ; } private getTimeString ( ) { return new Date ( ) . toISOString ( ) ; } } export default ConsoleLogger ;