8000 docs: fixed a couple of spelling errors · Hacker-FEX/log4js-node@42d38e6 · GitHub
[go: up one dir, main page]

Skip to content

Commit 42d38e6

Browse files
author
Gareth Jones
committed
docs: fixed a couple of spelling errors
1 parent f428d7d commit 42d38e6

File tree

4 files changed

+9
-3
lines changed

4 files changed

+9
-3
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# log4js-node changelog
22

3+
## 4.5.0
4+
* [Override call stack parsing](https://github.com/log4js-node/log4js-node/pull/914) - thanks [@rommni](https://github.com/rommni)
5+
* [patternLayout filename depth token](https://github.com/log4js-node/log4js-node/pull/913) - thanks [@rommni](https://github.com/rommni)
6+
37
## 4.4.0
48
* [Add option to pass appender module in config](https://github.com/log4js-node/log4js-node/pull/833) - thanks [@kaxelson](https://github.com/kaxelson)
59
* [Added docs for passing appender module](https://github.com/log4js-node/log4js-node/pull/904)

docs/api.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ This function takes a single optional string argument to denote the category to
3232
* `addContext(<key>,<value>)` - where `<key>` is a string, `<value>` can be anything. This stores a key-value pair that is added to all log events generated by the logger. Uses would be to add ids for tracking a user through your application. Currently only the `logFaces` appenders make use of the context values.
3333
* `removeContext(<key>)` - removes a previously defined key-value pair from the context.
3434
* `clearContext()` - removes all context pairs from the logger.
35-
* `setParseCallStackFunction(function)` - Allow to override the default way to parse the callstack data for the layout patern, a generic javascript Error object is passed to the function. Must return an object with properties : `functionName` / `fileName` / `lineNumber` / `columnNumber` / `callStack`. Can for exemple be used if all of your log call are made from one "debug" class and you would to "erase" this class from the callstack to only show the function which called your "debug" class.
35+
* `setParseCallStackFunction(function)` - Allow to override the default way to parse the callstack data for the layout pattern, a generic javascript Error object is passed to the function. Must return an object with properties : `functionName` / `fileName` / `lineNumber` / `columnNumber` / `callStack`. Can for example be used if all of your log call are made from one "debug" class and you would to "erase" this class from the callstack to only show the function which called your "debug" class.
3636
The `Logger` object has the following property:
3737
* `level` - where `level` is a log4js level or a string that matches a level (e.g. 'info', 'INFO', etc). This allows overriding the configured level for this logger. Changing this value applies to all loggers of the same category.
3838

lib/logger.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const categories = require('./categories');
1010
const configuration = require('./configuration');
1111

1212
const stackReg = /at (?:(.+)\s+\()?(?:(.+?):(\d+)(?::(\d+))?|([^)]+))\)?/;
13-
function defautParseCallStack(data, skipIdx = 4) {
13+
function defaultParseCallStack(data, skipIdx = 4) {
1414
const stacklines = data.stack.split('\n').slice(skipIdx);
1515
const lineMatch = stackReg.exec(stacklines[0]);
1616
if (lineMatch && lineMatch.length === 6) {
@@ -44,7 +44,7 @@ class Logger {
4444
}
4545
this.category = name;
4646
this.context = {};
47-
this.parseCallStack = defautParseCallStack;
47+
this.parseCallStack = defaultParseCallStack;
4848
debug(`Logger created (${this.category}, ${this.level})`);
4949
}
5050

types/log4js.d.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -307,6 +307,8 @@ export class Logger {
307307

308308
clearContext(): void;
309309

310+
setParseCallStackFunction(parseFunction: Function): void;
311+
310312
trace(message: any, ...args: any[]): void;
311313

312314
debug(message: any, ...args: any[]): void;

0 commit comments

Comments
 (0)
0