Skip to main content

Logger

local logger = game:get('Logger')

Logger service provides a way to log meaningful messages about the script. In editor, all logged messages are stored in the Logs tab:

Logger

Standard print function

The standard global print function is available without needing to load the Logger service. This function internally redirects all incoming messages to the debug channel (similar to Logger.debug):

print('This is a message', 12, myFunction, {hello="world"})

Methods

debug(...messages: any[]): void

Logs debug message

local logger = game:get("Logger")
logger.debug("This is a debug message", 12, myFunction, {hello="world"})

Parameters:

  • messages: Log messages as any type

info(...messages: any[]): void

Logs info message

local logger = game:get("Logger")
logger.debug("This is an info message", 12, myFunction, {hello="world"})

Parameters:

  • messages: Log messages as any type

warning(...messages: any[]): void

Logs warning message

local logger = game:get("Logger")
logger.debug("This is a warning message", 12, myFunction, {hello="world"})

Parameters:

  • messages: Log messages as any type

error(...messages: any[]): void

Logs error message

local logger = game:get("Logger")
logger.debug("This is an error message", 12, myFunction, {hello="world"})

Parameters:

  • messages: Log messages as any type

fatal(...messages: any[]): void

Logs fatal message

local logger = game:get("Logger")
logger.debug("This is a fatal message", 12, myFunction, {hello="world"})

Parameters:

  • messages: Log messages as any type