@squiz/component-logger-lib
Advanced tools
Comparing version 1.71.0 to 1.71.1
# @squiz/component-logger-lib | ||
## 1.71.1 | ||
### Patch Changes | ||
- 1187eec: manual bump of dx-common-lib version | ||
## 1.71.0 | ||
@@ -4,0 +10,0 @@ |
@@ -105,3 +105,10 @@ "use strict"; | ||
this.batch.push(...logs); | ||
console.error(err); | ||
if (!(err instanceof Error)) { | ||
throw err; | ||
} | ||
if ('response' in err && typeof err.response === 'object' && 'error' in err.response) { | ||
console.warn('Failed to post logs: %s', err.response.error); | ||
return; | ||
} | ||
console.warn('Failed to post logs: %s', err); | ||
} | ||
@@ -108,0 +115,0 @@ finally { |
@@ -357,5 +357,4 @@ "use strict"; | ||
const logger = new component_logger_1.ComponentLogger(loggerConfig); | ||
await logger.error('some error message', '123'); | ||
await logger.flush(); | ||
expect(consoleErrorSpy).toBeCalledWith(new Error('logging failed')); | ||
await expect(logger.error('some error message', '123')).resolves.toBeUndefined(); | ||
await expect(logger.flush()).resolves.toBeUndefined(); | ||
}); | ||
@@ -362,0 +361,0 @@ it.each([ |
{ | ||
"name": "@squiz/component-logger-lib", | ||
"version": "1.71.0", | ||
"version": "1.71.1", | ||
"description": "", | ||
@@ -22,3 +22,3 @@ "main": "lib/index.js", | ||
"devDependencies": { | ||
"@squiz/dx-common-lib": "^1.64.0", | ||
"@squiz/dx-common-lib": "^1.68.3", | ||
"@types/node": "20.12.12", | ||
@@ -25,0 +25,0 @@ "dotenv": "^16.0.3", |
@@ -415,6 +415,4 @@ import { ComponentLogger, MAX_MESSAGE_LENGTH, MAX_TAG_LENGTH } from './component-logger'; | ||
await logger.error('some error message', '123'); | ||
await logger.flush(); | ||
expect(consoleErrorSpy).toBeCalledWith(new Error('logging failed')); | ||
await expect(logger.error('some error message', '123')).resolves.toBeUndefined(); | ||
await expect(logger.flush()).resolves.toBeUndefined(); | ||
}); | ||
@@ -421,0 +419,0 @@ |
@@ -122,3 +122,12 @@ import superagent from 'superagent'; | ||
this.batch.push(...logs); | ||
console.error(err); | ||
if (!(err instanceof Error)) { | ||
throw err; | ||
} | ||
if ('response' in err && typeof err.response === 'object' && 'error' in err.response!) { | ||
console.warn('Failed to post logs: %s', err.response.error); | ||
return; | ||
} | ||
console.warn('Failed to post logs: %s', err); | ||
} finally { | ||
@@ -125,0 +134,0 @@ span.end(); |
@@ -12,5 +12,5 @@ { | ||
"references": [], | ||
"references": [{ "path": "../dx-common-lib" }], | ||
"include": ["src"], | ||
"exclude": ["jest.config.ts"] | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
162446
1376