Added JSDocs related to logging

This commit is contained in:
Matt Aitken
2023-07-03 16:21:14 +01:00
parent 917a70fbe9
commit a11ddf6564
4 changed files with 19 additions and 6 deletions
+6
View File
@@ -0,0 +1,6 @@
---
"@trigger.dev/sdk": patch
"@trigger.dev/internal": patch
---
Added JSDocs related to logging
+8
View File
@@ -1,5 +1,13 @@
// Create a logger class that uses the debug package internally
/**
* Represents different log levels.
* - `"log"`: Only essential messages.
* - `"error"`: Errors and essential messages.
* - `"warn"`: Warnings, Errors and essential messages.
* - `"info"`: Info, Warnings, Errors and essential messages.
* - `"debug"`: Everything.
*/
export type LogLevel = "log" | "error" | "warn" | "info" | "debug";
const logLevels: Array<LogLevel> = ["log", "error", "warn", "info", "debug"];
+1 -6
View File
@@ -41,12 +41,7 @@ export type JobOptions<
- integration Triggers, like webhooks. See the [integrations](https://trigger.dev/docs/integrations) page for more information. */
trigger: TTrigger;
/** The `logLevel` property is an optional property that specifies the level of
logging for the Job. The level is inherited from the client if you omit this property. It can have one of the following values:
- `log` - logs only essential messages
- `error` - logs error messages
- `warn` - logs errors and warning messages
- `info` - logs errors, warnings and info messages
- `debug` - logs everything with full verbosity */
logging for the Job. The level is inherited from the client if you omit this property. */
logLevel?: LogLevel;
/** Imports the specified integrations into the Job. The integrations will be available on the `io` object in the `run()` function with the same name as the key. For example:
```ts
@@ -56,8 +56,12 @@ export type TriggerClientOptions = {
only need to specify this if you are not using Trigger.dev Cloud and are
running your own Trigger.dev instance. */
apiUrl?: string;
/** The `logLevel` property is an optional property that specifies the level of
logging for the TriggerClient. The level is inherited by all Jobs that use this CLient, unless they also specify a `logLevel`. */
logLevel?: LogLevel;
/** Very verbose log messages */
verbose?: boolean;
/** Default is unset and off. If set to true it will log to the server's console as well as the Trigger.dev platform */
ioLogLocalEnabled?: boolean;
};