Console-SMP
A helper script for Spider Monkey Panel and foobar2000 which allows to permanently save console logs to a file using the existing method (console.log).
The problem with current Foobar2000's console
Default UI allows to open the console log into a panel and save its content to a file, but the option is reset on every start-up... thus defeating the idea of logging to a file. Since file logging may be useful on servers, specially when using headless installation and interacting with SMP scripts (to check response), this utility is offered as alternative.
Features
- Saves any message sent to the console on a text file (path configurable).
- Saving is not reset on every start-up (contrary to Foobar2000's native console).
- File is only reset when certain file size is reached (configurable).
- Works 'as is' without any modification on existing scripts, just include it and done.
- Converts sets and maps to arrays before logging.
- Converts standard objects and functions as strings before logging.
Usage
Just include the helper file:
include('helpers\\helpers_xxx_console.js');Since the original method has been wrapped, it will work without further modifications on an existing script:
console.log('This is output to log file at foobar profile folder and to console on UI.');A new method has been created to only send the message to the the UI console:
console.logUI('This is output only to console on UI. New method.');There is an usage example on the 'examples' folder.
Other implementations
- Playlist-Tools-SMP: Different tools for foobar2000.
- Playlist-Manager-SMP: A playlist manager for foobar2000.
- Any of my other scripts....
Installation
Since the addon only requires 1 file, i.e. the main helper, you can simply include it along any other script where you will use it.
