Skip to main content

Logging

active 🟢

npm version

GitHub

Interfacing

Functions

FunctionDescriptionParameters
sndMsgConsoleSends a message to the consolelogPage, logFunction, logMessage, logType, logBrowser, logDebug, slackHook
sndMsgApiSends a message to the API (backend)logMessage, logType, logDebug
sndMsgSlackSends a message to Slackmessage, slackHook

Parameters

ParameterTypeDescription
slackHookstringThe webhook url of the Slack channel
messagestringThe message to send to the Slack channel
logPagestringThe page or component where the log originates
logFunctionstringThe function or operation associated with the log
logMessagestringThe message to log
logTypenumberThe type of log message (1 = critical, 2 = warning, 3 = info)
logBrowserbooleanFlag to determine if browser information should be included
logDebugbooleanFlag 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]