Returns a console logging function which prefixes messages. This is
useful for tracing messages from different components. Each prefix
is assigned a colour, further helping to distinguish messages.
// And then use log(`Hello`); // console.log(`aHello`); error(`Uh-oh`); // console.error(`aUh-oh`); warn(`Eek!`); // console.warn(`aEeek!`);
Provide the colourKey parameter to make log messages
be coloured the same, even though the prefix is different.
// Both loggers will use the same colour because they // share the colour key `system` constlog = logger(`a`,`log`,`system`); constlog2 = logger(`b`, `log`, `system`);
Returns a console logging function which prefixes messages. This is useful for tracing messages from different components. Each prefix is assigned a colour, further helping to distinguish messages.
Use logSet to get a bundled set.
Provide the
colourKey
parameter to make log messages be coloured the same, even though the prefix is different.