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:
Fabi 2024-02-27 09:39:21 +01:00 committed by GitHub
parent b877abd7a2
commit 53099a282a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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());
}
```
```