mirror of
https://github.com/log4js-node/log4js-node.git
synced 2025-12-08 19:26:01 +00:00
chore(docs): updated typescript usage
This commit is contained in:
parent
818acd6818
commit
e61dbcc22d
13
README.md
13
README.md
@ -99,16 +99,15 @@ There's also [an example application](https://github.com/log4js-node/log4js-exam
|
||||
## TypeScript
|
||||
|
||||
```ts
|
||||
import { configure, getLogger } from "log4js";
|
||||
configure("./filename");
|
||||
const logger = getLogger();
|
||||
logger.level = "debug";
|
||||
logger.debug("Some debug messages");
|
||||
|
||||
configure({
|
||||
import log4js from "log4js";
|
||||
log4js.configure({
|
||||
appenders: { cheese: { type: "file", filename: "cheese.log" } },
|
||||
categories: { default: { appenders: ["cheese"], level: "error" } }
|
||||
});
|
||||
|
||||
const logger = log4js.getLogger();
|
||||
logger.level = "debug";
|
||||
logger.debug("Some debug messages");
|
||||
```
|
||||
|
||||
## Contributing
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user