623 Commits

Author SHA1 Message Date
Lam Wei Li
bc59c87050
Merge pull request #1401 from MamfTheKramf/http-response-chaining
fix: enable method chaining for after writeHead
2024-04-05 13:55:29 +08:00
Lam Wei Li
e1efb82829
fix(LoggingEvent): serde for object with null prototype 2024-04-04 15:30:56 +08:00
Mamf
24a6e36d94 Enable method chaining for after writeHead.
writeHead now also returns a reference to the response object as specified here: https://nodejs.org/api/http.html#responsewriteheadstatuscode-statusmessage-headers
2023-10-24 21:40:56 +02:00
gabriel-cloud
4dc786eaeb add maxLength to testCase 2023-05-20 20:39:36 +00:00
Lam Wei Li
883cbd0074
test: improved test for fileAppender 2023-02-20 13:46:29 +08:00
Lam Wei Li
df8931703b
feat: added log4js.isConfigured() API 2023-02-20 13:31:02 +08:00
Lam Wei Li
243592baf9
fix: tilde expansion 2023-02-20 02:03:10 +08:00
Benoît Lefèvre
5631e2ac22 feat issue #1341 (Layouts) : removing duplicated test 2022-12-05 12:01:40 +01:00
Benoît Lefèvre
0632c2197e feat issue #1341 (Layouts) : taking into account code review's feedback 2022-12-03 22:49:28 +01:00
Benoît Lefèvre
aedef32bb9 feat issue #1341 (Layouts) : support a specifier on %m 2022-11-14 02:13:14 +01:00
Lam Wei Li
a10f4a2941
feat(log4js): if cb is passed to shutdown(), it must be a function or it will throw error immediately 2022-10-02 02:54:57 +08:00
Lam Wei Li
6a8b706590
test(Logger): apart from asserting a throw, also assert the thrown error message 2022-10-02 01:15:06 +08:00
Lam Wei Li
6f697ad317
fix(LoggingEvent): throws error for invalid location passed when creating a new LoggingEvent 2022-10-02 01:15:05 +08:00
Lam Wei Li
8b44497193
test(logLevelFilter): renamed test description with correct filenames 2022-10-01 18:38:13 +08:00
Lam Wei Li
6f9c436896
fix(LoggingEvent): serde for NaN, Infinity, -Infinity, undefined 2022-10-01 18:37:41 +08:00
Zachary Haber
b1598c04c7
feat: add error to logging event from logger 2022-09-30 00:55:20 +08:00
Zachary Haber
0683535e0f
feat: add error property to LoggingEvent 2022-09-30 00:27:49 +08:00
Zachary Haber
0465894412
chore: tests for new parseCallStack functionality and changes 2022-09-29 23:27:50 +08:00
Lam Wei Li
2523e17a15
chore(deps-dev): bump prettier from 1.19.1 to 2.7.1 2022-09-28 17:22:38 +08:00
Lam Wei Li
995ef69a30
chore(deps-dev): bump nyc from 14.1.1 to 15.1.0 2022-09-28 17:20:13 +08:00
Lam Wei Li
4dc4c59e78
test: adjusted timeout interval for OS operations 2022-09-02 16:37:13 +08:00
Lam Wei Li
462e35a1fb
refactor(#1316): code flow and readability (%C:class, %M:function, %A:alias, %F:full - in order) 2022-09-01 21:54:54 +08:00
Pawel "l0ner" Soltys
dd3051d9ed
FIX: typo in LoggingEvent test
Co-authored-by: Lam Wei Li <peteriman@mail.com>
2022-09-01 19:28:45 +08:00
Pawel Soltys
6ea3e43c62 FIX: add missing field to test 2022-09-01 13:02:43 +02:00
Pawel Soltys
5f988bd097 FIX: remove unneeded test cases 2022-09-01 12:54:26 +02:00
Pawel Soltys
4360da010f FIX: missing test cases for %M, %C, %A and %F fields 2022-09-01 12:49:14 +02:00
Pawel Soltys
03b3f50870 FEAT: added %F field containing fully qualified caller name 2022-08-29 15:11:04 +02:00
Pawel Soltys
396a4de469 FEAT: patternLayout function name, class name and function alias
Added to patternLayout the following fields:

- %M - function name of the caller issuing the logging request
- %C - class name of the caller issuing the logging request
- %A - function alias of the caller issuing the logging request

The first two come from log4j, and use the same field specifiers.

When called from method bar of a Class foo:

- %M will be replaced with bar
- %C will be replaced with Foo
- %A will be empty

When called from function foo:

- %M will be replaced with foo
- %C will be empty
- %A will be empty

%A will be non empty only if the call stack parsed to obtain the values
contains string [as foo].
2022-08-27 22:00:53 +02:00
Lam Wei Li
745d689696
test: extended timeout interval for OS operations 2022-07-26 17:21:57 +08:00
Lam Wei Li
cbb12e450e
Merge branch 'master' into downgrade-nyc 2022-07-26 17:13:02 +08:00
Lam Wei Li
87b3897686
chore(deps-dev): downgraded nyc from 15.1.0 to 14.1.1 2022-07-26 17:06:36 +08:00
Lam Wei Li
4bc5589a28
style: ran prettier 2022-07-26 03:07:06 +08:00
Lam Wei Li
879e8c7646
refactor(test): forward-compatible with tap v15 when callback is removed from beforeEach and afterEach
in tap 15.0.0, libtap was added:
https://github.com/tapjs/libtap/compare/v0.3.0...v1.0.0#diff-e41924228a867ab0a0d8689f84ae6d826da70a0d65fc59ae2c69539035c4ef6aL905-L915
2022-07-25 22:37:42 +08:00
Lam Wei Li
5f617cc94b
refactor(test): added callback for beforeEach() and afterEach() for tap v14 downgrade 2022-07-25 22:37:32 +08:00
Lam Wei Li
798feb3544
test: extended timeout interval for OS operations 2022-07-25 21:16:07 +08:00
Lam Wei Li
0a936d1831
test: extended timeout interval for OS operations 2022-07-25 00:27:29 +08:00
Lam Wei Li
09c4096c49
test: adjusted regexp for stacktrace for Node.js <=10 2022-07-25 00:25:27 +08:00
Lam Wei Li
adcc06fb88
test: refactor fs.mkdirSync(..., { recursive: true }) for Node.js <10.12.0 2022-07-25 00:24:59 +08:00
Lam Wei Li
abe8e67a5c
test: polyfill fs.promises.unlink for Node.js <10 2022-07-25 00:24:58 +08:00
Lam Wei Li
35080bde5e
test: polyfill process.off for Node.js <10 2022-07-23 22:58:07 +08:00
Lam Wei Li
bf57536760
test: polyfill Promise.allSettled for Node.js <12 2022-07-23 22:58:06 +08:00
Eugene YOBOUE
e71e0888e9 test: clean-up test/tap/freeze-date-file-test 2022-07-08 21:32:17 +08:00
Eugene YOBOUE
04cbdfe6ab fix: update connect-logger.js #1284 2022-07-08 21:32:11 +08:00
Lam Wei Li
6acc345b59
Merge pull request #1279 from eyoboue/nolog-function
feat: adding function(req, res) support to connectLogger options->nol…
2022-07-04 15:46:27 +08:00
Lam Wei Li
2ff151bdc7
test: renamed dummy-appender.js to dummy-appender.cjs for test coverage 2022-07-04 01:26:40 +08:00
Eugene YOBOUE
9f18c6d6b9 feat: adding function(req, res) support to connectLogger options->nolog arg 2022-07-03 13:32:41 +00:00
Zachary Haber
cad9555948
style: run prettier:fix 2022-06-23 01:00:07 +08:00
Lam Wei Li
e378b597a6
style: prepare for prettier:fix 2022-06-23 01:00:00 +08:00
Lam Wei Li
e6eee6d2cf
refactor: clearer logic for invalid level and LOG synonym 2022-05-29 12:06:04 +08:00
Lam Wei Li
2825f7c9e4
feat: logger.log() to be synonym of logger.info() 2022-05-22 18:08:37 +08:00