Liquid Logging Utility


// Caffeine Overload
Nov 1, 2015
Reaction score
First Language
Primarily Uses
Liquid Logging - Version 1.0

Coming from a C#/Unity and C++ background, I felt the need to personally have a way to have better formatted log information in the console when debugging my scripts and events.

This may not serve much for a lot of you, but I figured I'd release it for those that it would serve well too. So I give you, Liquid_Logging. An extensible logging system for scripters and eventers to use

when debugging, or just to log information nicely! This is a logging system built similarly too logging systems like Log4Net, in that it is able to have different types of custom formatters and appenders created.

Ever wanted to be able to log stuff too files, or to a server? Well if the appender exists for this (it doesn't yet, maybe when I get the time <3) you can do just that. Basically this is a plugin that allows things to be logged to the console (and again, if you wanted too go a head and make the appender, custom things like files). 


- The ability to log formatted messages and objects to any built in appender (Developer Console for example).

- The ability to specify the format used as a pattern string.

- The ability to log messages from events using a plugin command.

- The ability to create custom appenders and formatters to suit your needs.

Console Appender Output Example:

Event Page Plugin Command Example: (generates the above screenshot)

How to Use
For better instructions, see the help menu for the script in the plugin manager.

Using In Your Own Scripts (One way)

 // Script setup stuff above this code... (didn't want too include it)   // Variable to see if logging is available.  var logging = false; var mySuperDuperLogger = null;  if (Imported.Liquid_Logging) {    mySuperDuperLogger = Liquid.Logging.getLogger("MySuperDuperLog");    var mySuperDuperAppender = new Liquid_ConsoleAppender();    var mySuperDuperFormat = new Liquid_PatternFormat("[%d{HH:mm:ss}] [%c] [%l]: %m");     mySuperDuperLogger.setLevel(Liquid_LogLevel.All);    mySuperDuperAppender.setFormat(mySuperDuperFormat);    mySuperDuperLogger.addAppender(mySuperDuperAppender);    logging = true;  }  else  {      logging = false;  } // The Liquid_Logging plugin exists we can log stuff!  if (logging) {"An Info message");   mySuperDuperLogger.debug("A Debug message");  mySuperDuperLogger.warn("A Warning message"); mySuperDuperLogger.error("An error message with an exception!",someExceptionGoesHere); } 
Using In events

To use in event simply call the Plugin Command as follows:

LiquidLog loglevelhere message goes here


LiquidLog info Info Message HURRAY!

LiquidLog debug DEBUG MESSAGE YES!

LiquidLog warn A WARNING

LiquidLog error AN ERROR!
Coming soon if you guys really want one.


Save the script as Liquid_Logging.js in your plugins file. 


Q: What are patterns?
A: Patterns are what the PatternFormatter type of formatter uses to generate the logging message format. They're basically strings of variables to determine what goes where. An example is: [%c] [%l]: %m

    That pattern would log messages as "[Logger Name] [Logging Level]: Your logged message goes here."

Q: How do we extend this as  afford mentioned?
A: Create a new object for whatever you want to make a custom thing for (Appender or Formatter), and base that object off Liquid_LogAppender (for appenders) or Liquid_LogFormat (for formats).

    You can take a look at the Liquid_ConsoleAppender and Liquid_PatternFormatter for examples of this.

Q: Any future plans to extend this?

A: Sure I have some ideas, but if you have suggestions feel free to post!

Credit and Terms of Use
- Liquidize

You are free to use and extend this as you will, credit isn't needed but is appreciated.

Author's Notes
I apologize if this is poorly written, I've only been using Javascript for a week, but think I've done pretty good since its similar to languages I am used too. I am working on refactoring the code and optimizing it, as well as reformatting the comments/commenting the methods. So please be paitent.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Would be nice to pick color code that is not exclusively for message event
The Ace attorney series are so great games... But at the same time such a travesty.
Made a video showcasing a plugin (by Lanza) that adds 5 more weather effects to our MV games. :LZYsmile: Namely:
Cherry Blossom Petals,
and bubbles.

Forum statistics

Latest member