egonlog 0.0.1 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1,8 +1,11 @@
1
1
  export type LogLevel = "error" | "warn" | "info" | "debug";
2
- export declare class Logger {
2
+ export type EgonLogConfig = {
3
+ level: LogLevel;
4
+ };
5
+ export declare class EgonLog {
3
6
  private level;
4
7
  private timers;
5
- constructor(level: LogLevel);
8
+ constructor(config: EgonLogConfig);
6
9
  private shouldLog;
7
10
  private log;
8
11
  error(...args: unknown[]): void;
package/dist/index.js CHANGED
@@ -5,11 +5,11 @@ const LOG_LEVELS = {
5
5
  info: 2,
6
6
  debug: 3,
7
7
  };
8
- export class Logger {
8
+ export class EgonLog {
9
9
  level;
10
10
  timers = {};
11
- constructor(level) {
12
- this.level = level;
11
+ constructor(config) {
12
+ this.level = config.level;
13
13
  }
14
14
  shouldLog(messageLevel) {
15
15
  return LOG_LEVELS[messageLevel] <= LOG_LEVELS[this.level];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "egonlog",
3
- "version": "0.0.1",
3
+ "version": "0.0.2",
4
4
  "description": "Simple logging library",
5
5
  "homepage": "https://github.com/egonSchiele/egonlog",
6
6
  "scripts": {