From dae2c0a1465fb28e2f54e1e7d367fe53d25bbbe4 Mon Sep 17 00:00:00 2001 From: Alex Sherwin Date: Sun, 4 Mar 2018 07:26:08 -0500 Subject: [PATCH] fixes #675 - added docs blurb about delegation to util.format --- docs/api.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/api.md b/docs/api.md index bc4aaaf..3475bfa 100644 --- a/docs/api.md +++ b/docs/api.md @@ -26,7 +26,7 @@ Properties: ## Loggers - `log4js.getLogger([category])` This function takes a single optional string argument to denote the category to be used for log events on this logger. If no category is specified, the events will be routed to the appender for the `default` category. The function returns a `Logger` object which has its level set to the level specified for that category in the config and implements the following functions: -* `(args...)` - where `` can be any of the lower case names of the levels (including any custom levels defined). For example: `logger.info('some info')` will dispatch a log event with a level of info. +* `(args...)` - where `` can be any of the lower case names of the levels (including any custom levels defined). For example: `logger.info('some info')` will dispatch a log event with a level of info. The logged string will have its formatting (placeholders like `%s`, `%d`, etc) delegated to [util.format](https://nodejs.org/api/util.html#util_util_format_format_args). * `isEnabled()` - returns true if a log event of level (camel case) would be dispatched to the appender defined for the logger's category. For example: `logger.isInfoEnabled()` will return true if the level for the logger is INFO or lower. * `addContext(,)` - where `` is a string, `` 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. * `removeContext()` - removes a previously defined key-value pair from the context.