Event Logger 2.4.1 (2012-02-06) [MM2+]

Download and get help for different MediaMonkey for Windows 4 Addons.

Moderators: Peke, Gurus

ZvezdanD
Posts: 3257
Joined: Thu Jun 08, 2006 7:40 pm

Event Logger 2.4.1 (2012-02-06) [MM2+]

Post by ZvezdanD »

Description:
This script is started as a short example which I posted in this thread, but it is now expanded and more configurable. It allows logging of next MM events: OnPlay, OnStop, OnPause, OnSeek, OnTrackEnd, OnPlaybackEnd, OnTrackSkipped, OnCompletePlaybackEnd, OnTrackProperties, OnTrackAdded, OnTrackDeleting, OnTrackConverted, OnBeforeTracksMove, OnStartUp and/or OnShutdown. Next data are stored in the log file: date/time, computer/user name, name of the event, track name. The location of the log file could be specified in the Options dialog box. The log file is saved in CSV format, so it could be imported e.g. in Excel. Events could be also displayed with the Event Viewer dockable panel.

Download:
http://solair.eunet.rs/~zvezdand/EventLogger.htm

Image

What is new:
v2.4.1 - 2012-02-06
* Fixed: using of Event Viewer and Logger in other scripts.

v2.4 - 2012-02-04
* Added: view of events without writing to the log file: OnChangedSelection, OnTrackListFilling, OnTrackListFilled, OnNowPlayingSelectionChanged, OnNowPlayingModified, OnTrackListSelectionChanged and OnTrackListModified [MMx];
* Added: possibility for script developers to use Event Viewer and Logger for displaying/logging messages from their code (please read the Usage section).

v2.3 - 2011-06-22
* Added: OnTrackSkipped and OnCompletePlaybackEnd events [MM4];
* Fixed: skin styles path [MM4];
* Fixed: visible state of Event Viewer after restart when it is closed on the [x] button from the Titlebar.

v2.2.1 - 2009-06-27
* Fixed: View Log File option and display of events in Event Viewer with log files in UTF-8/Unicode format.

v2.2 - 2009-05-13
* Added: OnPlaybackEnd event;
* Improved: skin styles;
* Fixed: error with Maximal log file size.

v2.1 - 2009-03-04
* Added: possibility to open a new log file when the file size is greater then specified value;
* Added: option in the context menu to open a specified log file into the Event Viewer;
* Added: display of information about opened log file and events range;
* Added: song position for Pause and Seek events;
* Improved: Event Viewer's skin automatically updated after skin change in the Options dialog box (only for supported skins).

v2.0 - 2009-03-01
* Added: Event Viewer dockable panel;
* Added: possibility to toggle Event Viewer title bar from the context menu (MM 3.1.0.1209 or up);
* Added: option Maximal # of rows in Event Viewer;
* Added: option Load log file when open Event Viewer;
* Added: option to save log file as ANSI, UTF-8 or Unicode.

v1.1.2 - 2009-02-07
* Fixed: deleting of tracks when enabled logging of the OnTrackDeleting event.

v1.1.1 - 2009-02-06
* Fixed: error with OnBeforeTracksMove and OnTrackProperties events.

v1.1 - 2009-02-06
* Added: OnBeforeTracksMove and OnTrackProperties events;
* Fixed: log file name when the "Write a new log file every day" is turned on.

v1.0 - 2009-02-05
* First public version.

Installation:
  • For MediaMonkey 3.0 or higher - just double-click on the EventLogger.mmip file; if you are on Vista or Win7 make sure you have MM3 set to "Run as Administrator"; if you downloaded the installation package with IE7 and it changed its extension to a .zip, you should first change it back to a .mmip.
  • For MediaMonkey 2.x - rename a .mmip extension to a .zip, extract the EventLogger.vbs and EventLoggerGUI.vbs files to the MediaMonkey's "Scripts\Auto" folder and restart MM program.
Usage:
Choose View | Event Viewer to show/hide dockable panel. The add-on settings are in the Tools | Options dialog box within the Event Logger sheet (turning on/off of events works immediately after the confirmation only with MM 3.1.0.1205 or higher).

Image

The script developers could use this add-on to display some text from their code by placing few additional lines of code on the appropriate places in the script. The scripters could use MsgBox or SDB.MessageBox instead, but they will halt the execution of the script which is not allways desirable. However, Event Logger and/or Event Viewer would log/display such messages without any break of the execution.

Here is what you should do if you want to use Event Viewer to display messages from your script:
- install Event Logger add-on;
- add the line Script.Include "Auto\EventLogger.vbs to your code, e.g. on its begin or end;
- add the line ViewEvent "some_text_e_g_script_name", "actual_text_e_g_some_variable" anywhere where you want to get the displayed message (for example, I could put ViewEvent "Magic Nodes", SDB.MainTree.CurrentNode.Caption in the OnChangedSelection event handler of my script);
- restart the program or use Script.Reload.

If you want to log messages, i.e. to get messages saved to the log file, you should use the LogEvent "abc", "xyz" syntax instead.
Last edited by ZvezdanD on Mon Feb 13, 2012 9:20 pm, edited 12 times in total.
Magic Nodes 4.3.3 / 5.2 RegExp Find & Replace 4.4.9 / 5.2  Invert Selection/Select None 1.5.1  Export/Create Playlists for Child Nodes 4.1.1 / 5.4.1  Expand Child Nodes/Expand All 1.1.2  Event Logger 2.7  Filtered Statistics Report 1.6  Track Redirection & Synchronization 3.4.2  Restore/Synchronize Database 3.1.8 / 4.0.1  Find Currently Playing Track 1.3.2  Queue List 1.2.1  Add to Library on Play 1.0.1  Tree Report for Child Nodes 1.1.1  Update Location of Files in Database 1.4.5 / 2.3  Inherit Child Playlists 1.0.3  Add Currently Playing/Selected Track(s) to Playlist 1.2
raybeau528
Posts: 401
Joined: Thu Sep 27, 2007 4:19 pm
Location: Connecticut

Re: Event Logger 1.0 (2009-02-05) [MM2+3]

Post by raybeau528 »

Very Nice!!!

Ray
nynaevelan
Posts: 5559
Joined: Wed Feb 07, 2007 11:07 pm
Location: New Jersey, USA
Contact:

Re: Event Logger 1.0 (2009-02-05) [MM2+3]

Post by nynaevelan »

Zvezdand:

Nice script, I have one problem and one question:

problem: When selecting the create a log each day option the date is added to the end of the file name so I have to go in and change the name in order to use Excel to open it.
question: Is there an On event for when tracks are selected to sync to a portable player? If so, can an event for that be added?

Nyn
3.2x - Win7 Ultimate (Zen Touch 2 16 GB/Zen 8GB)
Link to Favorite Scripts/Skins

Join Dropbox, the online site to share your files
ZvezdanD
Posts: 3257
Joined: Thu Jun 08, 2006 7:40 pm

Re: Event Logger 1.1 (2009-02-06) [MM2+3]

Post by ZvezdanD »

There is a new update, thanks for comments and report.

It doesn't exist some event for Sync operation, even after many requests for such thing. However, maybe you could use OnBeforeTracksMove event instead (it is called when a set of tracks is going to be copied/moved). I am not using syncing - please let me know if this event works in that case.

By the way, CSV format is just textual file with comma separated fields, so it could be also viewed with e.g. Notepad.
Magic Nodes 4.3.3 / 5.2 RegExp Find & Replace 4.4.9 / 5.2  Invert Selection/Select None 1.5.1  Export/Create Playlists for Child Nodes 4.1.1 / 5.4.1  Expand Child Nodes/Expand All 1.1.2  Event Logger 2.7  Filtered Statistics Report 1.6  Track Redirection & Synchronization 3.4.2  Restore/Synchronize Database 3.1.8 / 4.0.1  Find Currently Playing Track 1.3.2  Queue List 1.2.1  Add to Library on Play 1.0.1  Tree Report for Child Nodes 1.1.1  Update Location of Files in Database 1.4.5 / 2.3  Inherit Child Playlists 1.0.3  Add Currently Playing/Selected Track(s) to Playlist 1.2
nynaevelan
Posts: 5559
Joined: Wed Feb 07, 2007 11:07 pm
Location: New Jersey, USA
Contact:

Re: Event Logger 1.1 (2009-02-06) [MM2+3]

Post by nynaevelan »

I am getting an error when the OnTrackProperties selection is checked. It doesn't give anything except a box stating error executing script. I will not be able to try the OnMove logging until I get home this evening.

Nyn
3.2x - Win7 Ultimate (Zen Touch 2 16 GB/Zen 8GB)
Link to Favorite Scripts/Skins

Join Dropbox, the online site to share your files
ZvezdanD
Posts: 3257
Joined: Thu Jun 08, 2006 7:40 pm

Re: Event Logger 1.1.1 (2009-02-06) [MM2+3]

Post by ZvezdanD »

Sorry, there is a new revision with removed bugs.
Magic Nodes 4.3.3 / 5.2 RegExp Find & Replace 4.4.9 / 5.2  Invert Selection/Select None 1.5.1  Export/Create Playlists for Child Nodes 4.1.1 / 5.4.1  Expand Child Nodes/Expand All 1.1.2  Event Logger 2.7  Filtered Statistics Report 1.6  Track Redirection & Synchronization 3.4.2  Restore/Synchronize Database 3.1.8 / 4.0.1  Find Currently Playing Track 1.3.2  Queue List 1.2.1  Add to Library on Play 1.0.1  Tree Report for Child Nodes 1.1.1  Update Location of Files in Database 1.4.5 / 2.3  Inherit Child Playlists 1.0.3  Add Currently Playing/Selected Track(s) to Playlist 1.2
nynaevelan
Posts: 5559
Joined: Wed Feb 07, 2007 11:07 pm
Location: New Jersey, USA
Contact:

Re: Event Logger 1.1.1 (2009-02-06) [MM2+3]

Post by nynaevelan »

I found another one: If you have the OnTrackDelete option checked, it prevents the track from being deleted from the library/computer. Even though when you look in the log it says the track was deleted, but the track is still in the library and in the computer.

And in case I was remiss in saying it, I like this one. :D :D

Nyn
3.2x - Win7 Ultimate (Zen Touch 2 16 GB/Zen 8GB)
Link to Favorite Scripts/Skins

Join Dropbox, the online site to share your files
ZvezdanD
Posts: 3257
Joined: Thu Jun 08, 2006 7:40 pm

Re: Event Logger 1.1.2 (2009-02-07) [MM2+3]

Post by ZvezdanD »

Nyn, you are the best beta tester! Thanks so much for your assistance! Glad you like this one :)
Magic Nodes 4.3.3 / 5.2 RegExp Find & Replace 4.4.9 / 5.2  Invert Selection/Select None 1.5.1  Export/Create Playlists for Child Nodes 4.1.1 / 5.4.1  Expand Child Nodes/Expand All 1.1.2  Event Logger 2.7  Filtered Statistics Report 1.6  Track Redirection & Synchronization 3.4.2  Restore/Synchronize Database 3.1.8 / 4.0.1  Find Currently Playing Track 1.3.2  Queue List 1.2.1  Add to Library on Play 1.0.1  Tree Report for Child Nodes 1.1.1  Update Location of Files in Database 1.4.5 / 2.3  Inherit Child Playlists 1.0.3  Add Currently Playing/Selected Track(s) to Playlist 1.2
nynaevelan
Posts: 5559
Joined: Wed Feb 07, 2007 11:07 pm
Location: New Jersey, USA
Contact:

Re: Event Logger 1.1.2 (2009-02-07) [MM2+3]

Post by nynaevelan »

ZvezdanD wrote:Nyn, you are the best beta tester! Thanks so much for your assistance! Glad you like this one :)
Why thank you :D, you scripters take the time to make MM a better product, the least I could do is test it for you. Besides I am a sucker for punishment. :wink:

Nyn
3.2x - Win7 Ultimate (Zen Touch 2 16 GB/Zen 8GB)
Link to Favorite Scripts/Skins

Join Dropbox, the online site to share your files
ZvezdanD
Posts: 3257
Joined: Thu Jun 08, 2006 7:40 pm

Re: Event Logger 2.0 (2009-03-01) [MM2+3]

Post by ZvezdanD »

There is a new version of the script: v2.0 - 2009-03-01
- Added: Event Viewer dockable panel;
- Added: possibility to toggle Event Viewer title bar from the contex menu (MM 3.1.0.1209 or up);
- Added: option Maximal # of rows in Event Viewer;
- Added: option Load log file when open Event Viewer;
- Added: option to save log file as ANSI, UTF-8 or Unicode.
Magic Nodes 4.3.3 / 5.2 RegExp Find & Replace 4.4.9 / 5.2  Invert Selection/Select None 1.5.1  Export/Create Playlists for Child Nodes 4.1.1 / 5.4.1  Expand Child Nodes/Expand All 1.1.2  Event Logger 2.7  Filtered Statistics Report 1.6  Track Redirection & Synchronization 3.4.2  Restore/Synchronize Database 3.1.8 / 4.0.1  Find Currently Playing Track 1.3.2  Queue List 1.2.1  Add to Library on Play 1.0.1  Tree Report for Child Nodes 1.1.1  Update Location of Files in Database 1.4.5 / 2.3  Inherit Child Playlists 1.0.3  Add Currently Playing/Selected Track(s) to Playlist 1.2
nynaevelan
Posts: 5559
Joined: Wed Feb 07, 2007 11:07 pm
Location: New Jersey, USA
Contact:

Re: Event Logger 2.0 (2009-03-01) [MM2+3]

Post by nynaevelan »

Zvezdan:

First off, very nice update, especially the viewer. :D Secondly, is there a way to have the viewer have the same background colors as the active skin?? Third, a minor thing but is it possible to know at what point in the track it was paused and/or what point the track was at when it was stopped added to the log?

EDIT: Oh, I forgot one, if you have the log created everyday option enabled, for a future version can you include an option to be able to view the previous logs through the viewer?

Nyn
3.2x - Win7 Ultimate (Zen Touch 2 16 GB/Zen 8GB)
Link to Favorite Scripts/Skins

Join Dropbox, the online site to share your files
ZvezdanD
Posts: 3257
Joined: Thu Jun 08, 2006 7:40 pm

Re: Event Logger 2.0 (2009-03-01) [MM2+3]

Post by ZvezdanD »

nynaevelan wrote:is there a way to have the viewer have the same background colors as the active skin?
Yes, it is possible. You could adjust not only background, but also many other skinning elements of the displayed table. I have attached sample CSS files for 13 skins installed in the Scripts/Auto/SkinStyle folder, those are same .css files as with Magic Nodes and RegExp F&R. If you want to create CSS file for your preferred skin which is not already supported, you could copy some existing one and modify its styles. For example, color of the table background is:

Code: Select all

body.tbl {
    background-color: white;
}
Skins are automatically detected by their name and because of that the name of the .css file should be same as the name of the corresponding .msz file in the Skins folder.
nynaevelan wrote:is it possible to know at what point in the track it was paused and/or what point the track was at when it was stopped added to the log?
I could add this, however only Pause and Seek could give a current time. Unfortunately, the Stop event returns 0 for time.

How about to store that information with the event name? Something like: Pause at 3:45, and Seek to 5:67.
nynaevelan wrote:if you have the log created everyday option enabled, for a future version can you include an option to be able to view the previous logs through the viewer?
I am not sure, but I think it could be done relatively easy if I limit such thing only to log files with same prefix in the name (without date part). In that case the script could open log files from previous days automatically, without a need to modify user interface if you want to choose which file to open. Anyway, even in that case, the maximal number of rows should be considered and I am not sure how it would be slow if you set that number to some high value, e.g. 1000 or even more.
Magic Nodes 4.3.3 / 5.2 RegExp Find & Replace 4.4.9 / 5.2  Invert Selection/Select None 1.5.1  Export/Create Playlists for Child Nodes 4.1.1 / 5.4.1  Expand Child Nodes/Expand All 1.1.2  Event Logger 2.7  Filtered Statistics Report 1.6  Track Redirection & Synchronization 3.4.2  Restore/Synchronize Database 3.1.8 / 4.0.1  Find Currently Playing Track 1.3.2  Queue List 1.2.1  Add to Library on Play 1.0.1  Tree Report for Child Nodes 1.1.1  Update Location of Files in Database 1.4.5 / 2.3  Inherit Child Playlists 1.0.3  Add Currently Playing/Selected Track(s) to Playlist 1.2
nynaevelan
Posts: 5559
Joined: Wed Feb 07, 2007 11:07 pm
Location: New Jersey, USA
Contact:

Re: Event Logger 2.0 (2009-03-01) [MM2+3]

Post by nynaevelan »

ZvezdanD wrote: Yes, it is possible. You could adjust not only background, but also many other skinning elements of the displayed table. I have attached sample CSS files for 13 skins installed in the Scripts/Auto/SkinStyle folder, those are same .css files as with Magic Nodes and RegExp F&R. If you want to create CSS file for your preferred skin which is not already supported, you could copy some existing one and modify its styles. For example, color of the table background is:

Code: Select all

body.tbl {
    background-color: white;
}
Skins are automatically detected by their name and because of that the name of the .css file should be same as the name of the corresponding .msz file in the Skins folder.
Ok, I tried creating one (well actually copying one of the Lyrics Viewers ones so thank you for that. :D
ZvezdanD wrote:
How about to store that information with the event name? Something like: Pause at 3:45, and Seek to 5:67.
Yes this will work perfectly.
ZvezdanD wrote: I am not sure, but I think it could be done relatively easy if I limit such thing only to log files with same prefix in the name (without date part). In that case the script could open log files from previous days automatically, without a need to modify user interface if you want to choose which file to open. Anyway, even in that case, the maximal number of rows should be considered and I am not sure how it would be slow if you set that number to some high value, e.g. 1000 or even more.
I supposed I can turn off the create new log feature and not set a maximal value and this will eliminate the need to look for older logs. Let me work with that and see how it goes.

Nyn
3.2x - Win7 Ultimate (Zen Touch 2 16 GB/Zen 8GB)
Link to Favorite Scripts/Skins

Join Dropbox, the online site to share your files
Eyal
Posts: 3116
Joined: Sun Jun 26, 2005 9:27 am
Location: Québec

Re: Event Logger 2.0 (2009-03-01) [MM2+3]

Post by Eyal »

ZvezdanD wrote:There is a new version of the script: v2.0 - 2009-03-01
- Added: Event Viewer dockable panel;
- ...
COOL! :)
ZvezdanD wrote:
nynaevelan wrote:is there a way to have the viewer have the same background colors as the active skin?
Yes, it is possible. You could adjust not only background, but also many other skinning elements of the displayed table. I have attached sample CSS files for 13 skins installed in the Scripts/Auto/SkinStyle folder, those are same .css files as with Magic Nodes and RegExp F&R. If you want to create CSS file for your preferred skin which is not already supported, you could copy some existing one and modify its styles. For example, color of the table background is:

Code: Select all

body.tbl {
background-color: white;
}
Skins are automatically detected by their name and because of that the name of the .css file should be same as the name of the corresponding .msz file in the Skins folder.
Doubly COOL! :)

Thank you ZvezdanD!
Skins for MediaMonkey: Cafe, Carbon, Helium, Spotify, Zekton. [ Wiki Zone ].
Eyal
Posts: 3116
Joined: Sun Jun 26, 2005 9:27 am
Location: Québec

Re: Event Logger 2.0 (2009-03-01) [MM2+3]

Post by Eyal »

ZvezdanD, it's working great.

I use only one log file, and I noiced that the viewer is displaying the last x events specified in the options.
I think it would be good to have some info about the length of the log file(s) in the Event Viewer.
Maybe a status bar or info it the title that displays something like: "Events 865-965" or "Last 100 events of 965".

I don't think I'll ever use the New Log File Every Day function because I like to keep things simple and don't want to dig with hundred of files on my hard drive.
But I'm conscious of if the file become too large it may cause performance problems and lead to errors. For that reason, how about an option to limit the file length, or maybe a button on the Viewer to split the log file and create a fresh empty new one. What do you think?

Thanks

Eyal
Skins for MediaMonkey: Cafe, Carbon, Helium, Spotify, Zekton. [ Wiki Zone ].
Post Reply