Scripting API

Scripting API

Log

Class in Abyss.Core, from Abyss.Core.

The engine's log: what Bevy, the libraries under it, the editor and a game have said.

public static class Log

Remarks

One stream, and it is the engine's. A message written here goes where Bevy's own go: into the log the engine keeps, which the editor's Logs panel reads, and onto standard error in the line a Bevy game prints, so a game run from a terminal says what it said in the editor. Because both kinds travel together they arrive in the order they were said.

Safe from any thread, a system running in parallel included. Nothing here needs a World; the engine keeps the log for the whole process.

Properties

Latest

public static long Latest { get; }

The sequence number of the newest entry, or zero while there is none.

Methods

Info

public static void Info(string message)

Says something worth knowing, as the game.

Parameters

  • message

Warning

public static void Warning(string message)

Says something that is probably not what was meant, as the game.

Parameters

  • message

Error

public static void Error(string message)

Says something failed, as the game.

Parameters

  • message

Write

public static void Write(LogSeverity severity, string source, string message)

Says something as source.

Parameters

  • severity: How serious it is.
  • source: Who is speaking — editor, schedule, a subsystem of a game's. Kept with the message, and matched by RUST_LOG the way a Rust module path is.
  • message: What to say. Anything a string can hold, lines and all.

Exceptions

  • ArgumentOutOfRangeException: severity is not one of the three.

Constants

Game

public const string Game = "game"

The source a script's message is written under.