Skip to content

Logging

Dan edited this page Oct 19, 2017 · 2 revisions

Logging in Surge is pretty simple

  • Supports Colors in the console
  • Supports Sync & Async logging (buffered)
  • Supports preset modes
    • Warning
    • Verbose
    • Info
    • Fatal
    • Success
  • Supports instance tagging (no tag results in plugin name)

Log with surge.util.D

D.l("This is an INFO message");
D.w("This is a WARN message");
D.f("This is a FATAL message");
D.v("This is a VERBOSE message");
D.s("This is a SUCCESS message");

You can also pass in a reference to an object for it's class name to show up in the prefix of the log

// Without specifying an object, your plugin instance is assumed.
D.l(this, "This is an INFO message");
D.w(this, "This is a WARN message");
D.f(this, "This is a FATAL message");
D.v(this, "This is a VERBOSE message");
D.s(this, "This is a SUCCESS message");
Clone this wiki locally