@alwatr/logger
Advanced tools
Comparing version 0.25.0 to 0.26.0
@@ -6,2 +6,15 @@ # Change Log | ||
# [0.26.0](https://github.com/AliMD/alwatr/compare/v0.25.0...v0.26.0) (2022-12-22) | ||
### Bug Fixes | ||
- set correct path ([d01ce6f](https://github.com/AliMD/alwatr/commit/d01ce6ffa749a5e3e0e11e35b4ed61d75d61fec9)) | ||
- tsconfig ([e96dcd3](https://github.com/AliMD/alwatr/commit/e96dcd30774a9f06f7d051e0504192cbbe019e35)) | ||
### Features | ||
- improve error debugging ([1fba504](https://github.com/AliMD/alwatr/commit/1fba50400a1e8ececc10bbe8ea11cc8dcea2289c)) | ||
- **logger:** add root version ([2ac01c1](https://github.com/AliMD/alwatr/commit/2ac01c1d12323a6c8591b3dd4826d08a55647dc1)) | ||
- **logger:** move incident to deployment mode ([4ee8dac](https://github.com/AliMD/alwatr/commit/4ee8dac5c54ce8a897382d3d4fb5bb852d24cf24)) | ||
# [0.25.0](https://github.com/AliMD/alwatr/compare/v0.24.1...v0.25.0) (2022-12-07) | ||
@@ -8,0 +21,0 @@ |
@@ -7,3 +7,3 @@ var _a, _b, _c, _d, _e, _f; | ||
export const alwatrRegisteredList = ((_a = globalThis.Alwatr) === null || _a === void 0 ? void 0 : _a.registeredList) || []; | ||
(_b = globalThis.Alwatr) !== null && _b !== void 0 ? _b : (globalThis.Alwatr = { registeredList: alwatrRegisteredList }); | ||
(_b = globalThis.Alwatr) !== null && _b !== void 0 ? _b : (globalThis.Alwatr = { version: '0.25.0', registeredList: alwatrRegisteredList }); | ||
alwatrRegisteredList.push({ | ||
@@ -104,5 +104,2 @@ name: '@alwatr/logger', | ||
scope, | ||
incident: isBrowser | ||
? console.log.bind(console, '%c%s%c.%s() Incident `%s` %s!', styleScope, scope, 'color: orange;') | ||
: console.log.bind(console, `${styleScope}🚸\n%s${style.reset}.%s() Incident \`%s\` %s!${style.reset}`, scope), | ||
accident: isBrowser | ||
@@ -123,2 +120,3 @@ ? console.warn.bind(console, '%c%s%c.%s() Accident `%s` %s!', styleScope, scope, style.reset) | ||
logOther: empty, | ||
incident: empty, | ||
}; | ||
@@ -134,4 +132,7 @@ } | ||
logOther: console.debug.bind(console, keySection, styleScope, scope, style.reset), | ||
incident: isBrowser | ||
? console.log.bind(console, '%c%s%c.%s() Incident `%s` %s!', styleScope, scope, 'color: orange;') | ||
: console.log.bind(console, `${styleScope}🚸\n%s${style.reset}.%s() Incident \`%s\` %s!${style.reset}`, scope), | ||
}; | ||
}; | ||
//# sourceMappingURL=logger.js.map |
{ | ||
"name": "@alwatr/logger", | ||
"version": "0.25.0", | ||
"version": "0.26.0", | ||
"description": "Fancy colorful console debugger with custom scope written in tiny TypeScript, ES module.", | ||
@@ -28,5 +28,5 @@ "keywords": [ | ||
"url": "https://github.com/AliMD/alwatr", | ||
"directory": "packages/core/logger" | ||
"directory": "core/logger" | ||
}, | ||
"homepage": "https://github.com/AliMD/alwatr/tree/main/packages/core/logger#readme", | ||
"homepage": "https://github.com/AliMD/alwatr/tree/main/core/logger#readme", | ||
"bugs": { | ||
@@ -38,3 +38,3 @@ "url": "https://github.com/AliMD/alwatr/issues" | ||
}, | ||
"gitHead": "03cf3c146f075309527bcf1e762a589696d0ce1d" | ||
"gitHead": "95b0562adb46ab0266d860251e16aa0c4e9b4c09" | ||
} |
@@ -151,3 +151,3 @@ # Alwatr Logger - `@alwatr/logger` | ||
catch (err) { | ||
logger.error('myMethod', 'error_code', (err as Error).stack || err, {a: 1, b: 2}); | ||
logger.error('myMethod', 'error_code', err, {a: 1, b: 2}); | ||
} | ||
@@ -179,3 +179,3 @@ ``` | ||
failPromiseTest().catch((err) => | ||
logger.error('myMethod', (err as Error).message || 'error_code', (err as Error).stack || err) | ||
logger.error('myMethod', (err as Error).message || 'error_code', err) | ||
); | ||
@@ -191,3 +191,3 @@ | ||
'failPromiseTest failed!, ' + (err as Error).message, | ||
(err as Error).stack || err | ||
err | ||
); | ||
@@ -194,0 +194,0 @@ // do something to handle the error... |
export interface GlobalAlwatr { | ||
version: string; | ||
registeredList: Array<{ | ||
@@ -79,3 +80,4 @@ name: string; | ||
/** | ||
* `console.log` an event or expected accident. (not warn or error) | ||
* `console.log` an event or expected accident. | ||
* not warn or error just important information. | ||
* | ||
@@ -90,3 +92,3 @@ * Example: | ||
/** | ||
* `console.warn` an unexpected accident or error that you handled. | ||
* `console.warn` an unexpected accident or error that you handled like warning. | ||
* | ||
@@ -110,7 +112,7 @@ * Example: | ||
* catch (err) { | ||
* logger.error('myMethod', 'error_code', (err as Error).stack || err, {a: 1, b: 2}); | ||
* logger.error('myMethod', 'error_code', err, {a: 1, b: 2}); | ||
* } | ||
* ``` | ||
*/ | ||
error(method: string, code: string, errorStack: string | unknown, ...args: unknown[]): void; | ||
error(method: string, code: string, ...args: unknown[]): void; | ||
/** | ||
@@ -117,0 +119,0 @@ * Simple `console.debug` with styled scope. |
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
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
No website
QualityPackage does not have a website.
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
No website
QualityPackage does not have a website.
Found 1 instance in 1 package
38582
286