Skip to content

SudoSOS Back-end API / internal / helpers

Internal: Helpers ​

This is the module page of logging.

Classes ​

ClassDescription
POSTokenVerifierUtility class for verifying POS tokens in lesser authentication scenarios. This class handles the verification logic for ensuring that lesser tokens (PIN/NFC authentication) are properly associated with the correct POS.

Interfaces ​

InterfaceDescription
RequestContextDiagnostic information about the request that is currently being handled.
StructuredLogEventThe shape of a single line of JSON log output.

Functions ​

FunctionDescription
applyConfiguredLogLevel-
flattenLogDataSplit the arguments of a log call into its message and its fields. The first string that was logged becomes the message, plain objects are merged into the fields, and everything else ends up under args. Both log('msg', { field }) and log({ field }, 'msg') are therefore understood.
getAppLogger-
getConfiguredLogLevel-
getRequestContext-
initRedisConnectionTry to connect to Redis. If it is unreachable in non-production environments, resolves to undefined so callers can fall back to direct SMTP sending. In production a missing Redis connection is a hard failure.
runWithRequestContextRun the given function with the given request context bound to it. The context remains available in everything the function awaits or schedules.
setRequestActorRecord which user the current request is authenticated as. Does nothing when called outside of a request.
toPrettyLogLineRender a log4js event as a single human-readable line, keeping the request id so that the pretty format stays correlatable as well.
toStructuredLogEventFlatten a log4js event into a single record, annotated with the context of the request that produced it.