camunda-external-task-client-js
Version:
Implement your [BPMN Service Task](https://docs.camunda.org/manual/latest/user-guide/process-engine/external-tasks/) in NodeJS.
61 lines (42 loc) • 1.18 kB
Markdown
is a simple middleware that logs various events in the client lifecycle. It can be configured using different log-levels.
```js
const { Client, logger } = require("camunda-external-task-client-js");
const client = new Client({
use: logger,
baseUrl: "http://localhost:8080/engine-rest"
});
```
Returns a logger instance with the configured log level.
```js
const { Client, logger } = require("camunda-external-task-client-js");
const client = new Client({
use: logger.level('debug'),
baseUrl: "http://localhost:8080/engine-rest"
});
```
The levels correspond to the npm logging levels:
```JSON
{
error: 0,
warn: 1,
info: 2,
verbose: 3,
debug: 4,
silly: 5
}
```
If you do not specify a log level, `info` will be used.
Receives a text and produces a success message out of it.
```js
console.log(logger.success("This is a success message!"));
```

Receives a text and produces an error message out of it.
```js
console.log(logger.error("This is an error message!"));
```

A logger