mirror of
https://github.com/zitadel/zitadel.git
synced 2025-03-01 00:37:24 +00:00
docs: log module for actions (#7448)
* docs: log module for actions * Update modules.md --------- Co-authored-by: Livio Spring <livio.a@gmail.com>
This commit is contained in:
parent
b877abd7a2
commit
53099a282a
@ -52,6 +52,40 @@ The object has the following fields and methods:
|
||||
- `text()` *string*
|
||||
Returns the body
|
||||
|
||||
## Log
|
||||
|
||||
The log module provides you with the functionality to log to stdout.
|
||||
|
||||
### Import
|
||||
|
||||
```js
|
||||
let logger = require("zitadel/log")
|
||||
```
|
||||
|
||||
### `log()`, `warn()`, `error()` function
|
||||
|
||||
The logger offers three distinct log levels (info, warn, and error) to effectively communicate messages based on their severity, enhancing debugging and troubleshooting efficiency.
|
||||
Use the function that reflects your log level.
|
||||
|
||||
- log()
|
||||
- warn()
|
||||
- error()
|
||||
|
||||
### Example
|
||||
|
||||
```js
|
||||
logger.info("This is an info log.")
|
||||
|
||||
logger.warn("This is a warn log.")
|
||||
|
||||
logger.error("This is an error log.")
|
||||
```
|
||||
|
||||
#### Parameters
|
||||
|
||||
- `msg` *string*
|
||||
The message you want to print out.
|
||||
|
||||
## UUID
|
||||
|
||||
This module provides functionality to generate a UUID
|
||||
@ -105,4 +139,4 @@ function setUUID(ctx, api) {
|
||||
|
||||
api.v1.user.appendMetadata('custom-id', uuid.v4());
|
||||
}
|
||||
```
|
||||
```
|
||||
|
Loading…
x
Reference in New Issue
Block a user