diff options
author | Elizabeth Hunt <elizabeth.hunt@simponic.xyz> | 2024-12-15 13:05:50 -0800 |
---|---|---|
committer | Elizabeth Hunt <elizabeth.hunt@simponic.xyz> | 2024-12-15 13:53:43 -0800 |
commit | c0a96e82af651724314114df2d0019ecb83c2830 (patch) | |
tree | 9e65dea31c62786cb8970b713a078bab2868be1b /src/logger.ts | |
parent | 6f45fe5a10174fd33932d17dc056898f06466067 (diff) | |
download | uptime-c0a96e82af651724314114df2d0019ecb83c2830.tar.gz uptime-c0a96e82af651724314114df2d0019ecb83c2830.zip |
small refactorings
Diffstat (limited to 'src/logger.ts')
-rw-r--r-- | src/logger.ts | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/logger.ts b/src/logger.ts index 05d9fd9..ffe8f51 100644 --- a/src/logger.ts +++ b/src/logger.ts @@ -1,10 +1,16 @@ import type { IO } from "fp-ts/lib/IO"; export interface Logger { - log: (message: string) => IO<void>; + info: (message: string) => IO<void>; + error: (message: string) => IO<void>; + warn: (message: string) => IO<void>; } export const ConsoleLogger: Logger = { - log: (message: string) => () => - console.log(`[${new Date().toUTCString()}] ` + message), + info: (message: string) => () => + console.log(`[${new Date().toUTCString()}] INFO ` + message), + error: (message: string) => () => + console.error(`[${new Date().toUTCString()}] ERROR ` + message), + warn: (message: string) => () => + console.warn(`[${new Date().toUTCString()}] WARN ` + message), }; |