Logging
active 🟢
Interfacing
Functions
| Function | Description | Parameters |
|---|---|---|
| sndMsgConsole | Sends a message to the console | logPage, logFunction, logMessage, logType, logBrowser, logDebug, slackHook |
| sndMsgApi | Sends a message to the API (backend) | logMessage, logType, logDebug |
| sndMsgSlack | Sends a message to Slack | message, slackHook |
Parameters
| Parameter | Type | Description |
|---|---|---|
slackHook | string | The webhook url of the Slack channel |
message | string | The message to send to the Slack channel |
logPage | string | The page or component where the log originates |
logFunction | string | The function or operation associated with the log |
logMessage | string | The message to log |
logType | number | The type of log message (1 = critical, 2 = warning, 3 = info) |
logBrowser | boolean | Flag to determine if browser information should be included |
logDebug | boolean | Flag to determine if debug information should be included |
All functions return the following:
response: The response of the function which contains status and data an example can be seen below
If the function is successful, it returns the following:
{
"status": "success",
"data": {
// data
}
}
If the function fails, it returns the following:
{
"status": "error",
"error": "error message"
}
TS interface
export const authFields = [
'slack_hook'
] as const
export type authFields = typeof authFields[number]