Ocean Solutions

Log

Colour-coded console logging utilities for server-side output

Overview

The log module provides a small set of functions for printing formatted, colour-coded messages to the server console. Each level maps to a distinct FiveM colour code so log lines are easy to scan at a glance.

It is exported as log and also accessible via _G.log / Ocean.log.

Colour Reference

LevelConsole Colour
infoGreen (^2)
errorRed (^1)
warningYellow (^3)
successGreen (^2)
debugBlue (^4)
mainGreen label, custom type text

Functions

log.info

Ocean.log.info(text)

Prints an informational message.

  • text: string

log.error

Ocean.log.error(text)

Prints an error message.

  • text: string

log.warning

Ocean.log.warning(text)

Prints a warning message.

  • text: string

log.success

Ocean.log.success(text)

Prints a success message.

  • text: string

log.debug

Ocean.log.debug(text)

Prints a debug message.

  • text: string

log.main

Ocean.log.main(type, text)

Prints a message with a custom label rendered in green.

  • type: string — the label shown in brackets, e.g. "DISCORD-API"
  • text: string

Example

Ocean.log.info("Server started")
Ocean.log.success("Database connected")
Ocean.log.warning("Config value missing, using default")
Ocean.log.error("Failed to reach external API")
Ocean.log.debug("Player data: " .. json.encode(playerData))
Ocean.log.main("MY-MODULE", "Custom label message")

On this page