Skip to content

Commit

Permalink
- global logger is internal
Browse files Browse the repository at this point in the history
- LogLevel.ERROR for !env.DEBUG, else INFO
  • Loading branch information
CrazyFlasher committed Sep 24, 2023
1 parent 2bf9e98 commit 1d1b8d0
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
3 changes: 2 additions & 1 deletion .env
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
CONFIG=dev.json
CONFIG=dev.json
DEBUG=true
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "domwires",
"version": "0.9.127",
"version": "0.9.129",
"description": "Flexible and extensible MVC framework",
"repository": {
"type": "git",
Expand All @@ -17,7 +17,8 @@
"inversify": "6.0.1",
"inversify-inject-decorators": "3.1.0",
"reflect-metadata": "0.1.13",
"browser-or-node": "2.1.1"
"browser-or-node": "2.1.1",
"dotenv": "16.0.3"
},
"devDependencies": {
"esbuild": "0.15.18",
Expand All @@ -27,7 +28,6 @@
"@typescript-eslint/parser": "5.41.0",
"chai": "4.3.6",
"copyfiles": "2.4.1",
"dotenv": "16.0.3",
"eslint": "8.26.0",
"eslint-plugin-no-type-assertion": "1.3.0",
"mocha": "10.2.0",
Expand Down
6 changes: 5 additions & 1 deletion src/com/domwires/core/Global.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,16 @@
/* eslint-disable no-type-assertion/no-type-assertion */

import {Logger, LogLevel} from "../logger/ILogger";
import * as process from "process";
import * as dotenv from "dotenv";

dotenv.config();

export type Class<T> = new(...args: T[]) => T;

export type Type<T = any> = string | Class<T>;

export const logger = new Logger(LogLevel.INFO);
const logger = new Logger(!process.env.DEBUG ? LogLevel.ERROR : LogLevel.INFO);

const defaultImplMap: Map<string | Class<any>, Class<any>> = new Map<string | Class<any>, Class<any>>();

Expand Down

0 comments on commit 1d1b8d0

Please sign in to comment.