@autofleet/logger 4.0.0 → 4.0.1

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.
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,29 @@
1
+ import Pino from 'pino';
2
+ export declare enum LogLevel {
3
+ trace = "trace",
4
+ debug = "debug",
5
+ info = "info",
6
+ warn = "warn",
7
+ error = "error",
8
+ fatal = "fatal"
9
+ }
10
+ type LogLevels = 'trace' | 'debug' | 'info' | 'warn' | 'error' | 'fatal';
11
+ type MiddlewareFunction = () => Record<string, unknown>;
12
+ declare class LoggerInstanceManager {
13
+ contextMiddlewares: MiddlewareFunction[];
14
+ logger: Pino.Logger;
15
+ constructor(logLevel?: LogLevel);
16
+ winstonLikeLoggerCall(logLevel: LogLevel, message: string, meta: unknown): void;
17
+ addMetadata(): Record<string, unknown>;
18
+ addContextMiddleware(middleware: MiddlewareFunction): void;
19
+ trace(message: string, meta?: unknown): void;
20
+ debug(message: string, meta?: unknown): void;
21
+ info(message: string, meta?: unknown): void;
22
+ warn(message: string, meta?: unknown): void;
23
+ error(message: string, meta?: unknown): void;
24
+ fatal(message: string, meta?: unknown): void;
25
+ child(metadata: Record<string, unknown>): Pino.Logger<never>;
26
+ get level(): Pino.LevelWithSilentOrString;
27
+ }
28
+ declare const _default: (loglevel?: LogLevels) => LoggerInstanceManager;
29
+ export default _default;
@@ -0,0 +1 @@
1
+ export {};
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@autofleet/logger",
3
- "version": "4.0.0",
3
+ "version": "4.0.1",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
7
7
  "coverage": "jest --coverage --forceExit --runInBand",
8
8
  "test": "jest --runInBand",
9
9
  "test-auto": "jest --watch --runInBand",
10
- "linter": "./node_modules/.bin/eslint .",
10
+ "linter": "./node_modules/.bin/eslint ./src",
11
11
  "build": "tsc",
12
12
  "prepublishOnly": "npm run build",
13
13
  "example": "ts-node example.ts"
package/tsconfig.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "compilerOptions": {
3
- "target": "ES6", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */
3
+ "target": "ES6",
4
4
  "module": "commonjs", /* Specify what module code is generated. */ /* Allow 'import x from y' when a module doesn't have a default export. */
5
5
  "esModuleInterop": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */
6
6
  // "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */
@@ -8,6 +8,8 @@
8
8
 
9
9
  /* Type Checking */
10
10
  "strict": true, /* Enable all strict type-checking options. */
11
- "outDir": "./dist"
11
+ "outDir": "./dist",
12
+ "declaration": true,
13
+ "rootDir": "./src",
12
14
  }
13
15
  }
File without changes
File without changes
File without changes