@rbxts/rlog > LogContext > start
LogContext.start() method
Creates a new LogContext.
Signature:
static start(config?: PartialRLogConfig): LogContext;
Parameters
Parameter | Type | Description |
---|---|---|
config | (Optional) Config to use for the context. RLog instances that use this context will merge their configs with the config of the context. |
Returns:
A new LogContext instance.
Remarks
The context can be used to create RLog instances by calling use.
When you're done with the context, make sure to call stop to prevent memory leaks.
Example
function GiveMoney(context: LogContext, player: Player, money: number) {
// ...
}
remotes.giveMoney.connect((player: Player, money: number) => {
const context = LogContext.start();
GiveMoney(context, player, money);
context.stop();
});