Repository: graphql-markdown/graphql-markdown
Pull request #967 (2023-08-24 13:22:54)

:recycle:  refactor logger module
# Description

Clean up `Logger`:
 - expose a `log()` function that should be use for any logging purpose
 - auto instantiate the logger if not defined
 - `Logger()` now returns `void`

# Checklist

- [x] My changes follow the [contributing guidelines](https://github.com/graphql-markdown/graphql-markdown/blob/main/CONTRIBUTING.md) of this project.
- [x] I have performed a self-review of my code.
- [x] I have made corresponding changes to the documentation.
- [x] I have added tests that prove my fix is effective or that my changes work.
- [x] New and existing unit tests pass locally with my changes.


codesee-maps[bot]: <details open>
<summary><b>👇 <a href="https://app.codesee.io/r/reviews?pr=967&src=https%3A%2F%2Fgithub.com%2Fgraphql-markdown%2Fgraphql-markdown">Click on the image</a> for a new way to code review</b>
</summary>

####

[![Review these changes using an interactive CodeSee Map](https://s3.us-east-2.amazonaws.com/maps.codesee.io/images/github/graphql-markdown/graphql-markdown/967/7d7202f8/1d1607ca09c8f696cbba7d2c2d7f4dc8240460ec.svg)](https://app.codesee.io/r/reviews?pr=967&src=https%3A%2F%2Fgithub.com%2Fgraphql-markdown%2Fgraphql-markdown)

#### Legend
<img src="https://app.codesee.io/Legend_v3.png" alt="CodeSee Map legend" width="220" height="156">
</details>
sonarcloud[bot]: Kudos, SonarCloud Quality Gate passed!&nbsp; &nbsp; [![Quality Gate passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/passed-16px.png 'Quality Gate passed')](https://sonarcloud.io/dashboard?id=graphql-markdown_graphql-markdown&pullRequest=967)

[![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=graphql-markdown_graphql-markdown&pullRequest=967&resolved=false&types=BUG) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=graphql-markdown_graphql-markdown&pullRequest=967&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=graphql-markdown_graphql-markdown&pullRequest=967&resolved=false&types=BUG)  
[![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png 'Vulnerability')](https://sonarcloud.io/project/issues?id=graphql-markdown_graphql-markdown&pullRequest=967&resolved=false&types=VULNERABILITY) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=graphql-markdown_graphql-markdown&pullRequest=967&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=graphql-markdown_graphql-markdown&pullRequest=967&resolved=false&types=VULNERABILITY)  
[![Security Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png 'Security Hotspot')](https://sonarcloud.io/project/security_hotspots?id=graphql-markdown_graphql-markdown&pullRequest=967&resolved=false&types=SECURITY_HOTSPOT) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/security_hotspots?id=graphql-markdown_graphql-markdown&pullRequest=967&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=graphql-markdown_graphql-markdown&pullRequest=967&resolved=false&types=SECURITY_HOTSPOT)  
[![Code Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png 'Code Smell')](https://sonarcloud.io/project/issues?id=graphql-markdown_graphql-markdown&pullRequest=967&resolved=false&types=CODE_SMELL) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=graphql-markdown_graphql-markdown&pullRequest=967&resolved=false&types=CODE_SMELL) [0 Code Smells](https://sonarcloud.io/project/issues?id=graphql-markdown_graphql-markdown&pullRequest=967&resolved=false&types=CODE_SMELL)

[![No Coverage information](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/NoCoverageInfo-16px.png 'No Coverage information')](https://sonarcloud.io/component_measures?id=graphql-markdown_graphql-markdown&pullRequest=967) No Coverage information  
[![0.0%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/3-16px.png '0.0%')](https://sonarcloud.io/component_measures?id=graphql-markdown_graphql-markdown&pullRequest=967&metric=new_duplicated_lines_density&view=list) [0.0% Duplication](https://sonarcloud.io/component_measures?id=graphql-markdown_graphql-markdown&pullRequest=967&metric=new_duplicated_lines_density&view=list)


sonarcloud[bot]: Kudos, SonarCloud Quality Gate passed!&nbsp; &nbsp; [![Quality Gate passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/passed-16px.png 'Quality Gate passed')](https://sonarcloud.io/dashboard?id=graphql-markdown_graphql-markdown&pullRequest=967)

[![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=graphql-markdown_graphql-markdown&pullRequest=967&resolved=false&types=BUG) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=graphql-markdown_graphql-markdown&pullRequest=967&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=graphql-markdown_graphql-markdown&pullRequest=967&resolved=false&types=BUG)  
[![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png 'Vulnerability')](https://sonarcloud.io/project/issues?id=graphql-markdown_graphql-markdown&pullRequest=967&resolved=false&types=VULNERABILITY) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=graphql-markdown_graphql-markdown&pullRequest=967&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=graphql-markdown_graphql-markdown&pullRequest=967&resolved=false&types=VULNERABILITY)  
[![Security Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png 'Security Hotspot')](https://sonarcloud.io/project/security_hotspots?id=graphql-markdown_graphql-markdown&pullRequest=967&resolved=false&types=SECURITY_HOTSPOT) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/security_hotspots?id=graphql-markdown_graphql-markdown&pullRequest=967&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=graphql-markdown_graphql-markdown&pullRequest=967&resolved=false&types=SECURITY_HOTSPOT)  
[![Code Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png 'Code Smell')](https://sonarcloud.io/project/issues?id=graphql-markdown_graphql-markdown&pullRequest=967&resolved=false&types=CODE_SMELL) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=graphql-markdown_graphql-markdown&pullRequest=967&resolved=false&types=CODE_SMELL) [0 Code Smells](https://sonarcloud.io/project/issues?id=graphql-markdown_graphql-markdown&pullRequest=967&resolved=false&types=CODE_SMELL)

[![No Coverage information](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/NoCoverageInfo-16px.png 'No Coverage information')](https://sonarcloud.io/component_measures?id=graphql-markdown_graphql-markdown&pullRequest=967) No Coverage information  
[![0.0%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/3-16px.png '0.0%')](https://sonarcloud.io/component_measures?id=graphql-markdown_graphql-markdown&pullRequest=967&metric=new_duplicated_lines_density&view=list) [0.0% Duplication](https://sonarcloud.io/component_measures?id=graphql-markdown_graphql-markdown&pullRequest=967&metric=new_duplicated_lines_density&view=list)


sonarcloud[bot]: Kudos, SonarCloud Quality Gate passed!&nbsp; &nbsp; [![Quality Gate passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/passed-16px.png 'Quality Gate passed')](https://sonarcloud.io/dashboard?id=graphql-markdown_graphql-markdown&pullRequest=967)

[![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=graphql-markdown_graphql-markdown&pullRequest=967&resolved=false&types=BUG) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=graphql-markdown_graphql-markdown&pullRequest=967&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=graphql-markdown_graphql-markdown&pullRequest=967&resolved=false&types=BUG)  
[![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png 'Vulnerability')](https://sonarcloud.io/project/issues?id=graphql-markdown_graphql-markdown&pullRequest=967&resolved=false&types=VULNERABILITY) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=graphql-markdown_graphql-markdown&pullRequest=967&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=graphql-markdown_graphql-markdown&pullRequest=967&resolved=false&types=VULNERABILITY)  
[![Security Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png 'Security Hotspot')](https://sonarcloud.io/project/security_hotspots?id=graphql-markdown_graphql-markdown&pullRequest=967&resolved=false&types=SECURITY_HOTSPOT) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/security_hotspots?id=graphql-markdown_graphql-markdown&pullRequest=967&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=graphql-markdown_graphql-markdown&pullRequest=967&resolved=false&types=SECURITY_HOTSPOT)  
[![Code Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png 'Code Smell')](https://sonarcloud.io/project/issues?id=graphql-markdown_graphql-markdown&pullRequest=967&resolved=false&types=CODE_SMELL) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=graphql-markdown_graphql-markdown&pullRequest=967&resolved=false&types=CODE_SMELL) [0 Code Smells](https://sonarcloud.io/project/issues?id=graphql-markdown_graphql-markdown&pullRequest=967&resolved=false&types=CODE_SMELL)

[![No Coverage information](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/NoCoverageInfo-16px.png 'No Coverage information')](https://sonarcloud.io/component_measures?id=graphql-markdown_graphql-markdown&pullRequest=967) No Coverage information  
[![0.0%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/3-16px.png '0.0%')](https://sonarcloud.io/component_measures?id=graphql-markdown_graphql-markdown&pullRequest=967&metric=new_duplicated_lines_density&view=list) [0.0% Duplication](https://sonarcloud.io/component_measures?id=graphql-markdown_graphql-markdown&pullRequest=967&metric=new_duplicated_lines_density&view=list)


sonarcloud[bot]: Kudos, SonarCloud Quality Gate passed!&nbsp; &nbsp; [![Quality Gate passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/passed-16px.png 'Quality Gate passed')](https://sonarcloud.io/dashboard?id=graphql-markdown_graphql-markdown&pullRequest=967)

[![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=graphql-markdown_graphql-markdown&pullRequest=967&resolved=false&types=BUG) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=graphql-markdown_graphql-markdown&pullRequest=967&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=graphql-markdown_graphql-markdown&pullRequest=967&resolved=false&types=BUG)  
[![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png 'Vulnerability')](https://sonarcloud.io/project/issues?id=graphql-markdown_graphql-markdown&pullRequest=967&resolved=false&types=VULNERABILITY) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=graphql-markdown_graphql-markdown&pullRequest=967&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=graphql-markdown_graphql-markdown&pullRequest=967&resolved=false&types=VULNERABILITY)  
[![Security Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png 'Security Hotspot')](https://sonarcloud.io/project/security_hotspots?id=graphql-markdown_graphql-markdown&pullRequest=967&resolved=false&types=SECURITY_HOTSPOT) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/security_hotspots?id=graphql-markdown_graphql-markdown&pullRequest=967&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=graphql-markdown_graphql-markdown&pullRequest=967&resolved=false&types=SECURITY_HOTSPOT)  
[![Code Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png 'Code Smell')](https://sonarcloud.io/project/issues?id=graphql-markdown_graphql-markdown&pullRequest=967&resolved=false&types=CODE_SMELL) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=graphql-markdown_graphql-markdown&pullRequest=967&resolved=false&types=CODE_SMELL) [0 Code Smells](https://sonarcloud.io/project/issues?id=graphql-markdown_graphql-markdown&pullRequest=967&resolved=false&types=CODE_SMELL)

[![No Coverage information](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/NoCoverageInfo-16px.png 'No Coverage information')](https://sonarcloud.io/component_measures?id=graphql-markdown_graphql-markdown&pullRequest=967) No Coverage information  
[![0.0%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/3-16px.png '0.0%')](https://sonarcloud.io/component_measures?id=graphql-markdown_graphql-markdown&pullRequest=967&metric=new_duplicated_lines_density&view=list) [0.0% Duplication](https://sonarcloud.io/component_measures?id=graphql-markdown_graphql-markdown&pullRequest=967&metric=new_duplicated_lines_density&view=list)


what-the-diff[bot]: ## PR Summary 📝

Yay! 🎉 Looks like our developers have been working hard on improving the logging functionality and adding new features for our project with GraphQL. Here's a simple breakdown:

* **Simplified Logging Across Several Files** 🍃
We've tweaked several core files (like `diff.ts`, `generator.ts`, `graphql-config.ts` and `renderer.ts`) to import just a single, more efficient function, called `log`, from our `@graphql-markdown/logger` service.

* **Documentation & Testing for Logger** 📚
Added a new documentation file (`logger.md`) and test file (`logger.test.ts`) for our logger. This will help us understand and test the logging process more effectively!

* **New File Organization** 🗂️
We've created a handful of new files (`core.d.ts`, `graphql.d.ts`, `helpers.d.ts`, `index.ts`, and `logger.d.ts`) across the `logger/src`, `logger/docs`, `logger/tests/unit` and `types/src` paths to better organize our code. These files contain various definitions and features related to GraphQL and our custom Logger.

* **Improved Type Definitions** 📄
We have added type definitions. Types are like blueprints for our code that ensure we're using our data correctly. This includes updates to the `index.d.ts` and `utils.d.ts` files and a new `logger.d.ts` file for our @graphql-markdown/logger module.

* **Prettier Logging Update** ✨
Lastly, the logging format in `prettier.ts` has been updated for better readability, because pretty logs make for happy debugging! 🐞 

In the end, these changes will help us keep track of our app's performance and promptly spot and fix any issues. 😊 ⚡



Patch:
diff --git a/packages/core/src/diff.ts b/packages/core/src/diff.ts
index 43e5dacc..08e8b85e 100644
--- a/packages/core/src/diff.ts
+++ b/packages/core/src/diff.ts
@@ -5,9 +5,7 @@ import type {
   Maybe,
 } from "@graphql-markdown/types";
 
-import { Logger } from "@graphql-markdown/logger";
-
-const logger = Logger();
+import { log } from "@graphql-markdown/logger";
 
 export const hasChanges = async (
   schema: GraphQLSchema,
@@ -27,8 +25,9 @@ export const hasChanges = async (
     );
     return await checkSchemaChanges(schema, tmpDir, diffMethod);
   } catch (error: unknown) {
-    logger.warn(
+    log(
       `Cannot find module '${diffModule}' from @graphql-markdown/core!`,
+      "warn",
     );
     return true;
   }
diff --git a/packages/core/src/generator.ts b/packages/core/src/generator.ts
index bff32a2d..0baace31 100644
--- a/packages/core/src/generator.ts
+++ b/packages/core/src/generator.ts
@@ -4,7 +4,7 @@ import type {
   SchemaEntity,
 } from "@graphql-markdown/types";
 
-import { Logger } from "@graphql-markdown/logger";
+import { Logger, log } from "@graphql-markdown/logger";
 
 import {
   getCustomDirectives,
@@ -42,13 +42,14 @@ export const generateDocFromSchema = async ({
 }: GeneratorOptions): Promise<void> => {
   const start = process.hrtime.bigint();
 
-  const logger = Logger(loggerModule);
+  Logger(loggerModule);
 
   const loaders = await getDocumentLoaders(loadersList);
 
   if (!loaders) {
-    logger.error(
+    log(
       `An error occurred while loading GraphQL loader.\nCheck your dependencies and configuration.`,
+      "error",
     );
     return;
   }
@@ -62,7 +63,7 @@ export const generateDocFromSchema = async ({
       diffMethod as DiffMethodName,
     );
     if (!changed) {
-      logger.info(`No changes detected in schema "${String(schemaLocation)}".`);
+      log(`No changes detected in schema "${String(schemaLocation)}".`);
     }
   }
 
@@ -110,15 +111,16 @@ export const generateDocFromSchema = async ({
     Number(process.hrtime.bigint() - start) / NS_PER_SEC
   ).toFixed(SEC_DECIMALS);
 
-  logger.success(
+  log(
     `Documentation successfully generated in "${outputDir}" with base URL "${baseURL}".`,
+    "success",
   );
-  logger.info(
+  log(
     `${
       pages.flat().length
     } pages generated in ${duration}s from schema "${String(schemaLocation)}".`,
   );
-  logger.info(
+  log(
     `Remember to update your Docusaurus site's sidebars with "${sidebarPath}".`,
   );
 };
diff --git a/packages/core/src/graphql-config.ts b/packages/core/src/graphql-config.ts
index 7e194ba3..e20d4cd8 100644
--- a/packages/core/src/graphql-config.ts
+++ b/packages/core/src/graphql-config.ts
@@ -1,16 +1,13 @@
 import type {
   ClassName,
-  ConfigOptions,
-  GraphQLProjectConfig,
+  ExtensionProjectConfig,
   LoaderOption,
   Maybe,
   PackageConfig,
   PackageOptionsConfig,
 } from "@graphql-markdown/types";
 
-import { Logger } from "@graphql-markdown/logger";
-
-const logger = Logger();
+import { log } from "@graphql-markdown/logger";
 
 export const EXTENSION_NAME = "graphql-markdown" as const;
 export const GraphQLConfigExtension = () => ({ name: EXTENSION_NAME }) as const;
@@ -20,10 +17,6 @@ type ThrowOptions = {
   throwOnEmpty: boolean;
 };
 
-type Writeable<T> = { -readonly [P in keyof T]: T[P] };
-export type ExtensionProjectConfig = Omit<ConfigOptions, "schema"> &
-  Writeable<GraphQLProjectConfig>;
-
 export const setLoaderOptions = (
   loaders: LoaderOption,
   options: PackageOptionsConfig,
@@ -61,7 +54,7 @@ export const loadConfiguration = async (
   try {
     GraphQLConfig = await import("graphql-config");
   } catch (error) {
-    logger.log("Cannot find module 'graphql-config'!");
+    log("Cannot find module 'graphql-config'!");
     return undefined;
   }
 
diff --git a/packages/core/src/renderer.ts b/packages/core/src/renderer.ts
index 34d7a267..539d38bc 100644
--- a/packages/core/src/renderer.ts
+++ b/packages/core/src/renderer.ts
@@ -27,8 +27,7 @@ import {
   slugify,
 } from "@graphql-markdown/utils";
 
-import { Logger } from "@graphql-markdown/logger";
-const logger = Logger();
+import { log } from "@graphql-markdown/logger";
 
 const SIDEBAR = "sidebar-schema.js" as const;
 const CATEGORY_YAML = "_category_.yml" as const;
@@ -177,7 +176,7 @@ export class Renderer {
         return undefined;
       }
     } catch (error) {
-      logger.warn(`An error occurred while processing "${type}"`);
+      log(`An error occurred while processing "${type}"`, "warn");
       return undefined;
     }
 
@@ -192,8 +191,9 @@ export class Renderer {
     const page = PageRegex.exec(pagePath);
 
     if (!page?.groups) {
-      logger.warn(
+      log(
         `An error occurred while processing file ${filePath} for type "${type}"`,
+        "warn",
       );
       return undefined;
     }
diff --git a/packages/logger/docs/logger.md b/packages/logger/docs/logger.md
index bf1f158e..5503bfc8 100644
--- a/packages/logger/docs/logger.md
+++ b/packages/logger/docs/logger.md
@@ -2,40 +2,153 @@
 
 Logger singleton module.
 
+## Enumerations
+
+### LogLevel
+
+Log levels.
+
+#### Enumeration Members
+
+##### debug
+
+```ts
+debug: "debug"
+```
+
+###### Defined In
+
+[index.ts:20](https://github.com/graphql-markdown/graphql-markdown/blob/main/packages/logger/src/index.ts#L20)
+
+***
+
+##### error
+
+```ts
+error: "error"
+```
+
+###### Defined In
+
+[index.ts:21](https://github.com/graphql-markdown/graphql-markdown/blob/main/packages/logger/src/index.ts#L21)
+
+***
+
+##### info
+
+```ts
+info: "info"
+```
+
+###### Defined In
+
+[index.ts:22](https://github.com/graphql-markdown/graphql-markdown/blob/main/packages/logger/src/index.ts#L22)
+
+***
+
+##### log
+
+```ts
+log: "log"
+```
+
+###### Defined In
+
+[index.ts:23](https://github.com/graphql-markdown/graphql-markdown/blob/main/packages/logger/src/index.ts#L23)
+
+***
+
+##### success
+
+```ts
+success: "success"
+```
+
+###### Defined In
+
+[index.ts:24](https://github.com/graphql-markdown/graphql-markdown/blob/main/packages/logger/src/index.ts#L24)
+
+***
+
+##### warn
+
+```ts
+warn: "warn"
+```
+
+###### Defined In
+
+[index.ts:25](https://github.com/graphql-markdown/graphql-markdown/blob/main/packages/logger/src/index.ts#L25)
+
 ## Functions
 
 ### Logger
 
 ```ts
-Logger(moduleName?): LoggerType
+Logger(moduleName?): void
 ```
 
-Returns a logger module, if a package name is provided then instantiates it.
+Instantiate a logger module.
 By default, the logger module uses `global.console`
 
 #### Parameters
 
-| Parameter     | Type     | Description                          |
-| :------------ | :------- | :----------------------------------- |
+| Parameter | Type | Description |
+| :------ | :------ | :------ |
 | `moduleName`? | `string` | optional name of the logger package. |
 
 #### Returns
 
-`LoggerType`
-
-an instance of the logger.
+`void`
 
 #### Example
 
 ```js
-import { Logger } from "@graphql-markdown/utils/logger";
+import { Logger, log } from "@graphql-markdown/utils/logger";
+
+log("Info message"); // Expected console output "Info message"
+
+Logger("@docusaurus/logger");
+log("Info message", "info"); // Expected Docusaurus log output "Info message"
+```
+
+#### Defined In
+
+[index.ts:73](https://github.com/graphql-markdown/graphql-markdown/blob/main/packages/logger/src/index.ts#L73)
 
-Logger().info("Info message"); // Expected console output "Info message"
+***
+
+### log
+
+```ts
+log(message, level = LogLevel.info): void
+```
+
+Logs a message by calling the active logger instance.
+
+#### Parameters
+
+| Parameter | Type | Default value | Description |
+| :------ | :------ | :------ | :------ |
+| `message` | `string` | `undefined` | a string to be logged. |
+| `level` | `"debug"` \| `"error"` \| `"info"` \| `"log"` \| `"success"` \| `"warn"` \| [`LogLevel`](logger.md#loglevel) | `LogLevel.info` | optional log level, `"info"` by default. |
+
+#### Returns
+
+`void`
+
+#### Remarks
+
+If a log level is not supported by the logger instance, then it defaults to `"info"`.
+
+#### Example
+
+```js
+import { log } from "@graphql-markdown/utils/logger";
 
-const loggerModule = require.resolve("@docusaurus/logger");
-Logger(loggerModule).info("Info message"); // Expected Docusaurus log output "Info message"
+log("Info message"); // Expected console output "Info message"
 ```
 
 #### Defined In
 
-[index.ts:36](https://github.com/graphql-markdown/graphql-markdown/blob/main/packages/logger/src/index.ts#L36)
+[index.ts:45](https://github.com/graphql-markdown/graphql-markdown/blob/main/packages/logger/src/index.ts#L45)
diff --git a/packages/logger/src/index.ts b/packages/logger/src/index.ts
index 759ed35c..fb66930e 100644
--- a/packages/logger/src/index.ts
+++ b/packages/logger/src/index.ts
@@ -13,63 +13,81 @@ declare global {
 }
 
 /**
- * Returns a logger module, if a package name is provided then instantiates it.
- * By default, the logger module uses `global.console`
+ * Log levels.
  *
- * @internal
+ */
+export enum LogLevel {
+  debug = "debug",
+  error = "error",
+  info = "info",
+  log = "log",
+  success = "success",
+  warn = "warn",
+}
+
+/**
+ * Logs a message by calling the active logger instance.
  *
- * @param moduleName - optional name of the logger package.
+ * @remarks
+ * If a log level is not supported by the logger instance, then it defaults to `"info"`.
  *
- * @returns an instance of the logger.
+ * @param message - a string to be logged.
+ * @param level - optional log level, `"info"` by default.
  *
  * @example
  * ```js
- * import { Logger } from "@graphql-markdown/utils/logger";
+ * import { log } from "@graphql-markdown/utils/logger";
  *
- * Logger().info("Info message"); // Expected console output "Info message"
- *
- * const loggerModule = require.resolve("@docusaurus/logger");
- * Logger(loggerModule).info("Info message"); // Expected Docusaurus log output "Info message"
+ * log("Info message"); // Expected console output "Info message"
  * ```
  *
  */
-export const Logger = (moduleName?: string): LoggerType => {
-  if (global.logger && typeof moduleName === "undefined") {
-    return global.logger;
-  }
-
-  if (typeof moduleName !== "string" || moduleName === "") {
-    global.logger = global.console as unknown as LoggerType;
-  } else {
-    global.logger = require(moduleName) as unknown as LoggerType;
-  }
-
-  if (typeof global.logger.log === "undefined") {
-    global.logger.log = (...args: unknown[]): void =>
-      global.logger!.info.apply(null, args);
-  }
-
-  if (typeof global.logger.success === "undefined") {
-    global.logger.success = (...args: unknown[]): void =>
-      global.logger!.info.apply(null, args);
-  }
+export function log(
+  message: string,
+  level: LogLevel | keyof typeof LogLevel = LogLevel.info,
+): void {
+  Logger();
+  global.logger?._log(message, level);
+}
 
-  if (typeof global.logger.debug === "undefined") {
-    global.logger.debug = (...args: unknown[]): void =>
-      global.logger!.info.apply(null, args);
+/**
+ * Instantiate a logger module.
+ * By default, the logger module uses `global.console`
+ *
+ * @param moduleName - optional name of the logger package.
+ *
+ * @example
+ * ```js
+ * import { Logger, log } from "@graphql-markdown/utils/logger";
+ *
+ * log("Info message"); // Expected console output "Info message"
+ *
+ * Logger("@docusaurus/logger");
+ * log("Info message", "info"); // Expected Docusaurus log output "Info message"
+ * ```
+ *
+ */
+export const Logger = (moduleName?: string): void => {
+  if (global.logger?.instance && typeof moduleName === "undefined") {
+    return;
   }
 
-  if (typeof global.logger.warn === "undefined") {
-    global.logger.warn = (...args: unknown[]): void =>
-      global.logger!.info.apply(null, args);
-  }
+  const instance: LoggerType["instance"] =
+    typeof moduleName === "string" && moduleName !== ""
+      ? require(moduleName)
+      : global.console;
 
-  if (typeof global.logger.error === "undefined") {
-    global.logger.error = (...args: unknown[]): void =>
-      global.logger!.info.apply(null, args);
-  }
+  const _log = (
+    message: string,
+    level: LogLevel | keyof typeof LogLevel = LogLevel.info,
+  ): void => {
+    const fallback = instance[LogLevel.info];
+    const callback =
+      typeof instance[level] === "function" ? instance[level] : fallback;
+    callback?.apply(this, [message]);
+  };
 
-  return global.logger;
+  global.logger = { instance, _log };
 };
 
 export default Logger;
diff --git a/packages/types/src/core.d.ts b/packages/types/src/core.d.ts
index e795f8c3..0289d198 100644
--- a/packages/types/src/core.d.ts
+++ b/packages/types/src/core.d.ts
@@ -1,9 +1,10 @@
-import type { GraphQLSchema } from "graphql";
 import type { UnnormalizedTypeDefPointer } from "@graphql-tools/load";
+import type { BaseLoaderOptions } from "@graphql-tools/utils";
 
 import type {
   CustomDirective,
   DirectiveName,
+  GraphQLSchema,
   GroupByDirectiveOptions,
   LoaderOption,
   PackageName,
@@ -97,4 +98,33 @@ export type FunctionCheckSchemaChanges = (
 
 export type GeneratorOptions = Options & { loggerModule?: string };
 
+export type GroupByDirectiveOptions = {
+  directive: DirectiveName;
+  field: string;
+  fallback?: string;
+};
+
+export type LoaderOption = {
+  [name: ClassName]: PackageConfig | PackageName;
+};
+
+export type PackageOptionsConfig = BaseLoaderOptions & RootTypes;
+
+export type PackageConfig = {
+  module: PackageName;
+  options?: PackageOptionsConfig;
+};
+
+export type RootTypes = {
+  query?: string;
+  mutation?: string;
+  subscription?: string;
+};
+
+export type PackageName = string & { _opaque: typeof PackageName };
+declare const PackageName: unique symbol;
+
+export type ClassName = string & { _opaque: typeof ClassName };
+declare const ClassName: unique symbol;
+
 export type { GraphQLProjectConfig } from "graphql-config";
diff --git a/packages/types/src/graphql.d.ts b/packages/types/src/graphql.d.ts
new file mode 100644
index 00000000..02e40f38
--- /dev/null
+++ b/packages/types/src/graphql.d.ts
@@ -0,0 +1,79 @@
+import type {
+  ConfigOptions,
+  GraphQLDirective,
+  GraphQLEnumType,
+  GraphQLFieldMap,
+  GraphQLInputFieldMap,
+  GraphQLInputObjectType,
+  GraphQLInterfaceType,
+  GraphQLNamedType,
+  GraphQLObjectType,
+  GraphQLProjectConfig,
+  GraphQLScalarType,
+  GraphQLUnionType,
+  Maybe,
+} from ".";
+
+export type DeprecatedType<T> = Partial<{
+  deprecationReason: string;
+  isDeprecated: boolean;
+}> &
+  T;
+
+export type AstNodeType<T> = Required<{
+  astNode: ObjectTypeDefinitionNode;
+}> &
+  T;
+
+export type SchemaEntity =
+  | "directives"
+  | "enums"
+  | "inputs"
+  | "interfaces"
+  | "mutations"
+  | "objects"
+  | "queries"
+  | "scalars"
+  | "subscriptions"
+  | "unions";
+
+export type SchemaMap = {
+  queries?: Maybe<Record<string, GraphQLOperationType>>;
+  mutations?: Maybe<Record<string, GraphQLOperationType>>;
+  subscriptions?: Maybe<Record<string, GraphQLOperationType>>;
+  directives?: Maybe<Record<string, GraphQLDirective>>;
+  objects?: Maybe<Record<string, GraphQLObjectType<unknown, unknown>>>;
+  unions?: Maybe<Record<string, GraphQLUnionType>>;
+  interfaces?: Maybe<Record<string, GraphQLInterfaceType>>;
+  enums?: Maybe<Record<string, GraphQLEnumType>>;
+  inputs?: Maybe<Record<string, GraphQLInputObjectType>>;
+  scalars?: Maybe<Record<string, GraphQLScalarType<unknown, unknown>>>;
+};
+
+export type DirectiveName = string & { _opaque: typeof DirectiveName };
+declare const DirectiveName: unique symbol;
+
+export type SchemaEntitiesGroupMap = Partial<
+  Record<SchemaEntity, Record<string, Maybe<string>>>
+>;
+
+export type GraphQLOperationType =
+  | GraphQLFieldMap<unknown, unknown>
+  | GraphQLInputFieldMap
+  | Record<string, never>;
+
+export type RelationOfField =
+  | GraphQLDirective
+  | GraphQLNamedType
+  | GraphQLOperationType;
+export type RelationOfInterface = GraphQLInterfaceType | GraphQLObjectType;
+export type RelationOfImplementation = GraphQLUnionType | RelationOfInterface;
+export type ExtensionProjectConfig = Omit<ConfigOptions, "schema"> &
+  Writeable<GraphQLProjectConfig>;
+export type IGetRelation<T> = (
+  type: unknown,
+  schemaMap: Maybe<SchemaMap>,
+) => Partial<Record<SchemaEntity, T[]>>;
+type Writeable<T> = {
+  -readonly [P in keyof T]: T[P];
+};
diff --git a/packages/types/src/helpers.d.ts b/packages/types/src/helpers.d.ts
new file mode 100644
index 00000000..f1545f8c
--- /dev/null
+++ b/packages/types/src/helpers.d.ts
@@ -0,0 +1,24 @@
+import type { GraphQLDirective, DirectiveName } from ".";
+
+export type CustomDirectiveFunction = <T>(
+  directive?: GraphQLDirective,
+  node?: unknown,
+) => T;
+
+export type CustomDirectiveResolver = "descriptor" | "tag";
+
+export type CustomDirectiveOptions = {
+  [name in CustomDirectiveResolver]?: CustomDirectiveFunction;
+};
+
+export type CustomDirective = {
+  [name: DirectiveName]: CustomDirectiveOptions;
+};
+
+export type CustomDirectiveMapItem = CustomDirectiveOptions & {
+  type: GraphQLDirective;
+};
+
+export type CustomDirectiveMap = {
+  [name: DirectiveName]: CustomDirectiveMapItem;
+};
diff --git a/packages/types/src/index.d.ts b/packages/types/src/index.d.ts
index a78fc6d9..d40a4088 100644
--- a/packages/types/src/index.d.ts
+++ b/packages/types/src/index.d.ts
@@ -1,4 +1,7 @@
 export type {
+  ASTNode,
+  DirectiveDefinitionNode,
+  DirectiveNode,
   getDirectiveValues,
   getNamedType,
   GraphQLArgument,
@@ -22,11 +25,10 @@ export type {
   GraphQLType,
   GraphQLUnionType,
   ObjectTypeDefinitionNode,
-  ASTNode,
-  DirectiveDefinitionNode,
-  DirectiveNode,
 } from "graphql";
 
+export type { LoadSchemaOptions } from "@graphql-tools/load";
+
 export type Maybe<T> = T | null | undefined;
 
 // @graphql-markdown/core
@@ -37,3 +39,12 @@ export * from "./utils";
 
 // @graphql-markdown/printer-legacy
 export * from "./printer";
+
+// @graphql-markdown/logger
+export * from "./logger";
+
+// @graphql-markdown/graphql
+export * from "./graphql";
+
+// @graphql-markdown/helpers
+export * from "./helpers";
diff --git a/packages/types/src/logger.d.ts b/packages/types/src/logger.d.ts
new file mode 100644
index 00000000..85ee84c2
--- /dev/null
+++ b/packages/types/src/logger.d.ts
@@ -0,0 +1,8 @@
+type LogLevel = "debug" | "error" | "info" | "log" | "success" | "warn";
+
+export type LoggerType = {
+  _log: (message: string, level?: LogLevel) => void;
+  instance: {
+    [level in LogLevel]?: (...unknown) => void;
+  };
+};
diff --git a/packages/types/src/utils.d.ts b/packages/types/src/utils.d.ts
index cbe64c3e..1ff53070 100644
--- a/packages/types/src/utils.d.ts
+++ b/packages/types/src/utils.d.ts
@@ -1,154 +1,11 @@
-import type {
-  GraphQLDirective,
-  GraphQLEnumType,
-  GraphQLInputObjectType,
-  GraphQLInterfaceType,
-  GraphQLObjectType,
-  GraphQLScalarType,
-  GraphQLUnionType,
-  GraphQLFieldMap,
-  GraphQLInputFieldMap,
-  GraphQLDirective,
-  GraphQLNamedType,
-  GraphQLInterfaceType,
-  GraphQLObjectType,
-  GraphQLUnionType,
-  ObjectTypeDefinitionNode,
-} from "graphql";
-
-import type { BaseLoaderOptions } from "@graphql-tools/utils";
-
-import type { GraphQLOperationType, Maybe } from ".";
-
-export type CustomDirectiveFunction = <T>(
-  directive?: GraphQLDirective,
-  node?: unknown,
-) => T;
-
-export type CustomDirectiveResolver = "descriptor" | "tag";
-
-export type CustomDirectiveOptions = {
-  [name in CustomDirectiveResolver]?: CustomDirectiveFunction;
-};
-
-export type CustomDirective = {
-  [name: DirectiveName]: CustomDirectiveOptions;
-};
-
-export type DirectiveName = string & { _opaque: typeof DirectiveName };
-declare const DirectiveName: unique symbol;
-
-export type CustomDirectiveMapItem = CustomDirectiveOptions & {
-  type: GraphQLDirective;
-};
-
-export type CustomDirectiveMap = {
-  [name: DirectiveName]: CustomDirectiveMapItem;
-};
-
-export type GroupByDirectiveOptions = {
-  directive: DirectiveName;
-  field: string;
-  fallback?: string;
-};
-
-export type SchemaEntitiesGroupMap = Partial<
-  Record<SchemaEntity, Record<string, Maybe<string>>>
->;
-
-export type LoaderOption = {
-  [name: ClassName]: PackageConfig | PackageName;
-};
-
-export type PackageOptionsConfig = BaseLoaderOptions & RootTypes;
-
-export type PackageConfig = {
-  module: PackageName;
-  options?: PackageOptionsConfig;
-};
-
-export type RootTypes = {
-  query?: string;
-  mutation?: string;
-  subscription?: string;
-};
-
-export type PackageName = string & { _opaque: typeof PackageName };
-declare const PackageName: unique symbol;
-
-export type ClassName = string & { _opaque: typeof ClassName };
-declare const ClassName: unique symbol;
-
-export type SchemaEntity =
-  | "directives"
-  | "enums"
-  | "inputs"
-  | "interfaces"
-  | "mutations"
-  | "objects"
-  | "queries"
-  | "scalars"
-  | "subscriptions"
-  | "unions";
-
-export type SchemaMap = {
-  queries?: Maybe<Record<string, GraphQLOperationType>>;
-  mutations?: Maybe<Record<string, GraphQLOperationType>>;
-  subscriptions?: Maybe<Record<string, GraphQLOperationType>>;
-  directives?: Maybe<Record<string, GraphQLDirective>>;
-  objects?: Maybe<Record<string, GraphQLObjectType<unknown, unknown>>>;
-  unions?: Maybe<Record<string, GraphQLUnionType>>;
-  interfaces?: Maybe<Record<string, GraphQLInterfaceType>>;
-  enums?: Maybe<Record<string, GraphQLEnumType>>;
-  inputs?: Maybe<Record<string, GraphQLInputObjectType>>;
-  scalars?: Maybe<Record<string, GraphQLScalarType<unknown, unknown>>>;
-};
-
-export type IGetRelation<T> = (
-  type: unknown,
-  schemaMap: Maybe<SchemaMap>,
-) => Partial<Record<SchemaEntity, T[]>>;
-
-export type LoggerType = {
-  debug: Function; // eslint-disable-line @typescript-eslint/ban-types
-  error: Function; // eslint-disable-line @typescript-eslint/ban-types
-  info: Function; // eslint-disable-line @typescript-eslint/ban-types
-  log: Function; // eslint-disable-line @typescript-eslint/ban-types
-  success: Function; // eslint-disable-line @typescript-eslint/ban-types
-  warn: Function; // eslint-disable-line @typescript-eslint/ban-types
-};
+import type { Maybe } from ".";
 
 export type Category = { category: string; slug: string };
 
 export type MDXString = string & { _opaque: typeof MDXString };
 declare const MDXString: unique symbol;
 
-export type GraphQLOperationType =
-  | GraphQLFieldMap<unknown, unknown>
-  | GraphQLInputFieldMap
-  | Record<string, never>;
-
-export type RelationOfField =
-  | GraphQLDirective
-  | GraphQLNamedType
-  | GraphQLOperationType;
-export type RelationOfInterface = GraphQLInterfaceType | GraphQLObjectType;
-export type RelationOfImplementation = GraphQLUnionType | RelationOfInterface;
-
 export type PrettifyCallbackFunction = (
   text: string,
   options?: unknown,
 ) => Promise<Maybe<string>>;
-
-export type DeprecatedType<T> = Partial<{
-  deprecationReason: string;
-  isDeprecated: boolean;
-}> &
-  T;
-
-export type AstNodeType<T> = Required<{
-  astNode: ObjectTypeDefinitionNode;
-}> &
-  T;
-
-export type { LoadSchemaOptions } from "@graphql-tools/load";
diff --git a/packages/utils/src/prettier.ts b/packages/utils/src/prettier.ts
index 1bf397b1..f06d119f 100644
--- a/packages/utils/src/prettier.ts
+++ b/packages/utils/src/prettier.ts
@@ -33,7 +33,7 @@ export async function prettify(
     return await format(content, { parser });
   } catch (error: unknown) {
     if ("logger" in global) {
-      (global.logger as LoggerType).warn("Prettier is not found");
+      (global.logger as LoggerType)._log("Prettier is not found");
     } else {
       console.log("Prettier is not found");
     }


Test patch:
diff --git a/packages/logger/tests/unit/logger.test.ts b/packages/logger/tests/unit/logger.test.ts
index cb260e5a..d61f0286 100644
--- a/packages/logger/tests/unit/logger.test.ts
+++ b/packages/logger/tests/unit/logger.test.ts
@@ -1,21 +1,52 @@
-import Logger from "../../src";
+import * as Logger from "../../src";
 
 describe("logger", () => {
+  beforeEach(() => {
+    jest.spyOn(global.console, "info").mockImplementation(() => {});
+  });
+
   afterEach(() => {
     jest.restoreAllMocks();
     jest.resetAllMocks();
     global.logger = undefined;
   });
 
+  describe("log()", () => {
+    test("instantiates Logger", async () => {
+      expect.hasAssertions();
+
+      const spy = jest.spyOn(Logger, "Logger");
+
+      expect(global.logger).toBeUndefined();
+
+      Logger.log("test");
+
+      expect(spy).toHaveBeenCalled();
+      expect(global.logger).toBeDefined();
+    });
+
+    test("uses fallback log method if level not supported", async () => {
+      expect.hasAssertions();
+
+      const spy = jest.spyOn(global.console, "info");
+
+      Logger.log("test", "success");
+
+      expect(spy).toHaveBeenCalledWith("test");
+    });
+  });
+
   describe("Logger()", () => {
     test("returns a NodeJS.console object is no module passed", async () => {
       expect.hasAssertions();
 
-      jest
+      const spy = jest
         .spyOn(global.console, "info")
         .mockImplementation(() => "Mocked Console");
 
-      expect(Logger().info()).toBe("Mocked Console");
+      Logger.log("test");
+
+      expect(spy).toHaveLastReturnedWith("Mocked Console");
       expect(global.logger).toBeDefined();
     });
 
@@ -24,67 +55,66 @@ describe("logger", () => {
       async (moduleName) => {
         expect.hasAssertions();
 
-        jest
+        const spy = jest
           .spyOn(global.console, "info")
           .mockImplementation(() => "Mocked Console");
 
-        expect(Logger(moduleName).info()).toBe("Mocked Console");
+        Logger.Logger(moduleName);
+        Logger.log("test");
+
+        expect(spy).toHaveBeenCalledWith("test");
+        expect(spy).toHaveLastReturnedWith("Mocked Console");
         expect(global.logger).toBeDefined();
       },
     );
 
-    test("returns logger with aliased methods", () => {
+    test("instantiates a logger", () => {
       expect.hasAssertions();
 
-      expect(Logger()).toEqual(
+      Logger.Logger();
+
+      expect(global.logger?.instance).toEqual(
         expect.objectContaining({
           debug: expect.any(Function),
           error: expect.any(Function),
           info: expect.any(Function),
           log: expect.any(Function),
-          success: expect.any(Function),
           warn: expect.any(Function),
         }),
       );
     });
 
-    test("returns module passed with aliased methods", () => {
+    test("returns module passed", () => {
       expect.hasAssertions();
 
-      const logger = Logger(require.resolve("../__data__/dummy_logger"));
+      Logger.Logger(require.resolve("../__data__/dummy_logger"));
 
       expect(global.logger).toBeDefined();
-      expect(logger).toEqual(
+      expect(global.logger?.instance).toEqual(
         expect.objectContaining({
-          debug: expect.any(Function),
-          error: expect.any(Function),
           info: expect.any(Function),
-          log: expect.any(Function),
-          success: expect.any(Function),
-          warn: expect.any(Function),
         }),
       );
-      expect(logger.log()).toBe("Dummy logger");
-      expect(logger.debug()).toBe("Dummy logger");
-      expect(logger.error()).toBe("Dummy logger");
-      expect(logger.log()).toBe("Dummy logger");
-      expect(logger.success()).toBe("Dummy logger");
-      expect(logger.warn()).toBe("Dummy logger");
     });
 
     test("overrides current logger", async () => {
       expect.hasAssertions();
 
-      jest
+      const spyConsole = jest
         .spyOn(global.console, "info")
         .mockImplementation(() => "Mocked Console");
 
-      Logger();
+      Logger.Logger();
       expect(global.logger).toBeDefined();
 
-      const logger = Logger(require.resolve("../__data__/dummy_logger"));
+      Logger.Logger(require.resolve("../__data__/dummy_logger"));
+
+      const spyLogger = jest.spyOn(global.logger!, "_log");
+
+      Logger.log("test");
 
-      expect(logger.info()).toBe("Dummy logger");
+      expect(spyConsole).not.toHaveBeenCalled();
+      expect(spyLogger).toHaveBeenCalledWith("test", "info");
     });
   });
 });