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
| Level | Console Colour |
|---|---|
info | Green (^2) |
error | Red (^1) |
warning | Yellow (^3) |
success | Green (^2) |
debug | Blue (^4) |
main | Green label, custom type text |
Functions
log.info
Prints an informational message.
text:string
log.error
Prints an error message.
text:string
log.warning
Prints a warning message.
text:string
log.success
Prints a success message.
text:string
log.debug
Prints a debug message.
text:string
log.main
Prints a message with a custom label rendered in green.
type:string— the label shown in brackets, e.g."DISCORD-API"text:string