Skip to main content

@rbxts/rlog > functionTagEnricher

functionTagEnricher() function

Enricher for adding a tag to a log matching the function name, if absent.

Signature:

export declare function functionTagEnricher(entry: LogEntry): LogEntry;

Parameters

Parameter

Type

Description

entry

LogEntry

Returns:

LogEntry

Remarks

If the entry doesn't have a tag, then this enricher will use the nearest_function_name of where log occurred instead.

Example

const logger = new RLog({ enrichers: [functionTagEnricher] });

function CoolFunction() {
logger.i("Hello world!");
}

CoolFunction();
// > [INFO]: CoolFunction -> Hello world!