Log is a simple logging class, enabling both simple setup-free logging and more extensive event-based logging.
Enable/disable logging of caught Exceptions.
shouldLog |
A Boolean. NOTE: This creates a root level exception handler to allow logging of all exceptions. This will handle most but NOT all exceptions. Also, be aware that this risks throwing during exception handling, which is almost always bad - this should be considered unstable functionality. |
Log a message with a level of "debug". By default, these items are shown.
str |
A String |
... items |
Arguments to be passed to str.format (see String: -format) |
Log a message with a level of "error". By default, these items are shown.
str |
A String |
... items |
Arguments to be passed to str.format (see String: -format) |
Log a message with a level of "warning". By default, these items are shown.
str |
A String |
... items |
Arguments to be passed to str.format (see String: -format) |
Log a message with a level of "debug". By default, these items are shown.
str |
A String |
... items |
Arguments to be passed to str.format (see String: -format) |
A Boolean enabling / disabling posting of log events to the post window.
A log level. Anything events with this log level or higher will be logged.
inLevel |
A Symbol matching an entry in Log.levels (one of \debug, \info, \warning, \error, \critical). |
Log a message with a level of "info". By default, these items are shown.
str |
A String |
... items |
Arguments to be passed to str.format (see String: -format) |
An Integer representing the maximum log events to keep in the history of this log. This is relevent for log views.
A Function of the form { |item, log| }, where item is a log event and log is the parent Log object. Log items are Event objects with at least keys for \string (a string representation of the log event), \level (the log level), and \time. This function should return a formatted or serialized string representation of the log event. Generally, this is used to customize the string output of a specific log.
An IdentitySet containing functions to be executed for each new log event. Functions should be of the form: { |item, log| }, where item is a log event and log is the parent Log object.
When set to true
, multi-line strings will be split over multiple log lines - that is, each will be prepended with the name of the log.