Garry's Mod Wiki

HTML:ConsoleMessage

  HTML:ConsoleMessage( string msg, string file, number lineNr, string severity )

Description

Called when the page inside the HTML window runs the console.log javascript function.

On the x86-64 beta, it's called for all built-in console.* javascript functions.

Overwriting this function in any way will disable default behavior of printing the message to the in-game console.

Arguments

1 string msg
The message to be logged (or Lua code to be executed; see above).
2 string file
The message source file, if any.
3 number lineNr
The line number in the file the message was output from.
4 string severity
The severity of the message. Possible values are:
  • "log"
  • "warn"
  • "error"
  • "debug"
This was recently added in version (2025.09.22). It might only be available on the Dev Branch right now.