From 3b595aa202114ce239425675a7f9bc9f566e9953 Mon Sep 17 00:00:00 2001 From: Giulio Canti Date: Mon, 30 Dec 2024 12:49:14 +0100 Subject: [PATCH] Remove duplicate logger (#96) --- .changeset/stale-days-knock.md | 5 +++++ docs/modules/Logger.ts.md | 30 ------------------------------ docs/modules/Markdown.ts.md | 2 +- docs/modules/Parser.ts.md | 2 +- docs/modules/Process.ts.md | 2 +- src/Logger.ts | 17 ----------------- src/bin.ts | 2 -- 7 files changed, 8 insertions(+), 52 deletions(-) create mode 100644 .changeset/stale-days-knock.md delete mode 100644 docs/modules/Logger.ts.md delete mode 100644 src/Logger.ts diff --git a/.changeset/stale-days-knock.md b/.changeset/stale-days-knock.md new file mode 100644 index 0000000..6ea010e --- /dev/null +++ b/.changeset/stale-days-knock.md @@ -0,0 +1,5 @@ +--- +"@effect/docgen": patch +--- + +Remove duplicate logger diff --git a/docs/modules/Logger.ts.md b/docs/modules/Logger.ts.md deleted file mode 100644 index cde36ca..0000000 --- a/docs/modules/Logger.ts.md +++ /dev/null @@ -1,30 +0,0 @@ ---- -title: Logger.ts -nav_order: 7 -parent: Modules ---- - -## Logger overview - -Added in v1.0.0 - ---- - -

Table of contents

- -- [logging](#logging) - - [SimpleLogger](#simplelogger) - ---- - -# logging - -## SimpleLogger - -**Signature** - -```ts -export declare const SimpleLogger: Logger.Logger -``` - -Added in v1.0.0 diff --git a/docs/modules/Markdown.ts.md b/docs/modules/Markdown.ts.md index 3f40593..718dff4 100644 --- a/docs/modules/Markdown.ts.md +++ b/docs/modules/Markdown.ts.md @@ -1,6 +1,6 @@ --- title: Markdown.ts -nav_order: 8 +nav_order: 7 parent: Modules --- diff --git a/docs/modules/Parser.ts.md b/docs/modules/Parser.ts.md index fbafc3c..86b11ae 100644 --- a/docs/modules/Parser.ts.md +++ b/docs/modules/Parser.ts.md @@ -1,6 +1,6 @@ --- title: Parser.ts -nav_order: 9 +nav_order: 8 parent: Modules --- diff --git a/docs/modules/Process.ts.md b/docs/modules/Process.ts.md index 509fbcf..99b22b9 100644 --- a/docs/modules/Process.ts.md +++ b/docs/modules/Process.ts.md @@ -1,6 +1,6 @@ --- title: Process.ts -nav_order: 10 +nav_order: 9 parent: Modules --- diff --git a/src/Logger.ts b/src/Logger.ts deleted file mode 100644 index 1b9c338..0000000 --- a/src/Logger.ts +++ /dev/null @@ -1,17 +0,0 @@ -/** - * @since 1.0.0 - */ -import chalk from "chalk" -import * as Logger from "effect/Logger" - -/** - * @category logging - * @since 1.0.0 - */ -export const SimpleLogger = Logger.make(({ logLevel, message }) => { - if (logLevel._tag === "Debug") { - globalThis.console.log(chalk.gray(`[${logLevel.label}] ${message}`)) - } else { - globalThis.console.log(`[${logLevel.label}] ${message}`) - } -}) diff --git a/src/bin.ts b/src/bin.ts index 8a3d8b5..c033de8 100644 --- a/src/bin.ts +++ b/src/bin.ts @@ -12,13 +12,11 @@ import * as Logger from "effect/Logger" import * as LogLevel from "effect/LogLevel" import { cli } from "./CLI.js" import * as Configuration from "./Configuration.js" -import { SimpleLogger } from "./Logger.js" import * as Process from "./Process.js" /** @internal */ export const MainLive = Configuration.configProviderLayer.pipe( Layer.provideMerge(Layer.mergeAll( - Logger.replace(Logger.defaultLogger, SimpleLogger), Logger.minimumLogLevel(LogLevel.Info), Process.layer, NodeContext.layer