@ecdt/logger 1.0.0 → 1.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.
package/README.dev.md ADDED
@@ -0,0 +1,4 @@
1
+ # Fiz uma atualização e agora?
2
+
3
+ ## Atualize a versão
4
+ npm version patch
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ecdt/logger",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "Logger padronização de microsserviços da Econodata",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
package/src/index.d.ts ADDED
@@ -0,0 +1,10 @@
1
+ declare module '@ecdt/logger' {
2
+ export type LoggerOptions = {
3
+ format?: string;
4
+ extraFields?: Record<string, unknown>;
5
+ };
6
+
7
+ export function createLogger(
8
+ options?: LoggerOptions
9
+ ): (req: unknown, res: unknown, next: unknown) => void;
10
+ }
package/src/index.js CHANGED
@@ -9,7 +9,7 @@ function createLogger(options = {}) {
9
9
  }
10
10
 
11
11
  function format(tokens, req, res, options = {}){
12
- if(!options || !options.format) options.format == 'json'
12
+ if(!options || !options.format)options.format = 'json'
13
13
 
14
14
  const format = (options.format).toLowerCase()
15
15
  if(!formatsSupported.includes(format)){