Skip to main content

@rbxts/rlog > RLog

RLog class

Class for server-side Roblox Logging.

Signature:

export declare class RLog 

Remarks

You can also use rlog or rLog- for style purposes.

Constructors

Constructor

Modifiers

Description

(constructor)(config, context, inheritDefault)

Constructs a new RLog instance.

(constructor)(params)

Constructs a new RLog instance.

Uses the provided table in place of the argument names.

Properties

Property

Modifiers

Type

Description

context

readonly

LogContext | undefined

The LogContext assigned to this instance, if any.

default

static

readonly

RLog

The default or "global" RLog instance.

Methods

Method

Modifiers

Description

clone()

Creates a new RLog instance with all the same settings and properties.

clone(params)

Creates a new RLog instance with all the same settings and properties.

The provided parameters will be merged with the existing parameters on this instance.

d(message, data)

Shorthand version of debug.

debug(message, data)

Logs a debug message.

e(message, data)

Shorthand version of error.

error(message, data)

Logs an error message.

ForceContextFlush()

static

Force any pending messages to be sent through the sinks, regardless of the minLogLevel.

i(message, data)

Shorthand version of info.

info(message, data)

Logs an informational message.

log(level, message, data)

Logs a message with a specified log level.

ResetDefaultConfig()

static

Resets the config for the default instance to the original settings.

SetDefaultConfig(config)

static

Overwrites the config for the default instance.

UpdateDefaultConfig(config)

static

Merges the given config with the existing config for the default instance.

Since all RLog instances inherit their config from the default instance, this is a convenient way to provide default configuration settings.

v(message, data)

Shorthand version of verbose.

verbose(message, data)

Logs a verbose message.

w(message, data)

Shorthand version of warning.

warn(message, data)

Shorthand version of warning.

warning(message, data)

Logs a warning message.

withConfig(config)

Returns a new RLog with the provided config merged with the existing config.

withLogContext(context)

Returns a new RLog with the context set to the provided context.

withMinLogLevel(minLevel)

Returns a new RLog with the minLogLevel set to the provided level.

Messages below the minimum level will be ignored.

withTag(tag)

Returns a new RLog with the tag set to the provided string.