Log redirector and filter
- Pako
- Plugin Developer
- Posts: 2294
- Joined: Sat Nov 11, 2006 1:31 pm
- Location: Czech Republic
- Contact:
Log redirector and filter
I have in one PC installed EventGhost as a "service".
It's not obviously a really service, but EventGhost is started before user logon.
This is done using the Windows Scheduler (option When my computer starts (before a user logs on).
The problem is that in this case is not available EventGhost window and therefore the log.
That's why I made this plugin that allows you to save the log to a text file.
I think this plugin can be used in other situations too.
I made only very short tests, and so I do not know how the plugin will behave after prolonged use.
Pako
EDIT 2015-03-17: added new version 0.1.0
It's not obviously a really service, but EventGhost is started before user logon.
This is done using the Windows Scheduler (option When my computer starts (before a user logs on).
The problem is that in this case is not available EventGhost window and therefore the log.
That's why I made this plugin that allows you to save the log to a text file.
I think this plugin can be used in other situations too.
I made only very short tests, and so I do not know how the plugin will behave after prolonged use.
Pako
EDIT 2015-03-17: added new version 0.1.0
- Attachments
-
- __init__.py
- Plugin Log redirector and filter - version 0.1.0
- event filtering can be used even for native EventGhost log
- added identifiers INFO, NOTICE and ERROR
- filter string can contain curly brace wildcards {*} and {?} - (31.92 KiB) Downloaded 581 times
-
- __init__.py
- Plugin Log redirector - version 0.0.8 (support URL updated)
- (25.88 KiB) Downloaded 579 times
-
- __init__.py
- Plugin Log redirector - version 0.0.7
Requires EventGhost r1610 or later. - (25.82 KiB) Downloaded 517 times
You know flattr ? You can 

Re: Log redirector
EG uses a list to store the log messages I believe, with a size of 2000 or 10000 lines (I forget which). Would it be possible to do the same in this case, where the txt file is kept to some line count? What would be really interesting would be to push the logged lines into the UI once the users logs in, too.
Interesting idea, Pako.
Brett
Interesting idea, Pako.
Brett
-
- Plugin Developer
- Posts: 2570
- Joined: Sat Jun 30, 2007 2:51 pm
- Location: Stockholm, Sweden
- Contact:
Re: Log redirector
Hi Pako, I used a similar idea to create log files because I wanted to read the log data from remote (also over internet). In my case I wanted them to be easy to view with a browser so I created them with extension .html instead of .txt
Each time you then write a new line to the log file, you can add this string at the end "<br\n>" and it will look ok in the browser
But it depends of course what you want to do with the log data. If you want to parse & extract something, .txt is just fine
Best regards, Walter
Each time you then write a new line to the log file, you can add this string at the end "<br\n>" and it will look ok in the browser
But it depends of course what you want to do with the log data. If you want to parse & extract something, .txt is just fine
Best regards, Walter
My released plugins
https://drive.google.com/drive/folders/ ... y01eVBKeHM
https://drive.google.com/drive/folders/ ... y01eVBKeHM
- Pako
- Plugin Developer
- Posts: 2294
- Joined: Sat Nov 11, 2006 1:31 pm
- Location: Czech Republic
- Contact:
Re: Log redirector
Dear Walter!
What are the advantages html extension? I tried it, but it is much worse than the txt format. I would have to insert some formatting tags to the right indent.
BTW: I forgot one very important thing.
Log redirector plugin should be placed as high in the branch Autostart.
Best regards, Pako
I do not understand. All my browsers correctly display the contents of txt files (not ignoring the larger number of space characters in a row - that is, indent).krambriw wrote:In my case I wanted them to be easy to view with a browser so I created them with extension .html instead of .txt
What are the advantages html extension? I tried it, but it is much worse than the txt format. I would have to insert some formatting tags to the right indent.
BTW: I forgot one very important thing.
Log redirector plugin should be placed as high in the branch Autostart.
Best regards, Pako
You know flattr ? You can 

Re: Log redirector
Excellent Pako,
I have always been annoyed by the log system of eg.
My main problem is that I have a high rate of events in my tree, and when I want to check something, I usually don't have the time to see what happens, the log scrolls really to fast.
With your plugin (which I haven't tested yet), I will be able to look at what happens from the text file. It will be far more usable for me.
A nice feature for your plugin would be to implement filters. I have no precise idea of how you could do that, but usually, when you need the log, you don't need what is known to work.
I will try your plugin ASAP.
Thank you !
I have always been annoyed by the log system of eg.
My main problem is that I have a high rate of events in my tree, and when I want to check something, I usually don't have the time to see what happens, the log scrolls really to fast.
With your plugin (which I haven't tested yet), I will be able to look at what happens from the text file. It will be far more usable for me.
A nice feature for your plugin would be to implement filters. I have no precise idea of how you could do that, but usually, when you need the log, you don't need what is known to work.
I will try your plugin ASAP.
Thank you !
miljbee
TCP Events : A Better Network Event Sender/Receiver Plugin.
The Network Event Sender/Receiver in C#
Get events in EG from Google Calendar.
TCP Events : A Better Network Event Sender/Receiver Plugin.
The Network Event Sender/Receiver in C#
Get events in EG from Google Calendar.
-
- Plugin Developer
- Posts: 2570
- Joined: Sat Jun 30, 2007 2:51 pm
- Location: Stockholm, Sweden
- Contact:
Re: Log redirector
Dear Pako,
I just remember I once had problems to show .txt files in Internet browsers (the format did not display well and I always had to confirm that I wanted to open the .txt file) This was some years ago and maybe this is not a problem any more with recent browsers
Best regards, Walter
I just remember I once had problems to show .txt files in Internet browsers (the format did not display well and I always had to confirm that I wanted to open the .txt file) This was some years ago and maybe this is not a problem any more with recent browsers
Best regards, Walter
My released plugins
https://drive.google.com/drive/folders/ ... y01eVBKeHM
https://drive.google.com/drive/folders/ ... y01eVBKeHM
Re: Log redirector
This is a really great plugin for debugging a very busy tree.
Anyway, I would like to be able to specify the "commit interval" in seconds. Having to wait at least one minute to see what has happened when you are debugging is a bit long.
And as written above, implementing filters would be awesome. Since everything in eg is driven by events, it would be great to filter them (and the macro they trigger).
For exemple, in the conf dialog of the plugin, we could have 2 fields to define filters for exclusion or inclusion.
In these fields we would write event Names.
when logging to a file, your plugin should match the event name defined in the exclusion filters. If it matches, then do nothing until next event. If it doesn't match, write log file until next event.
It's the same for inclusion filter : if it matches an event from the inclusion list, then write log to file until next event.
I had a quick look at your code to see if I could implement this by myself, but haven't understand anything ... I am to bad with python !
Regards,
Anyway, I would like to be able to specify the "commit interval" in seconds. Having to wait at least one minute to see what has happened when you are debugging is a bit long.
And as written above, implementing filters would be awesome. Since everything in eg is driven by events, it would be great to filter them (and the macro they trigger).
For exemple, in the conf dialog of the plugin, we could have 2 fields to define filters for exclusion or inclusion.
In these fields we would write event Names.
when logging to a file, your plugin should match the event name defined in the exclusion filters. If it matches, then do nothing until next event. If it doesn't match, write log file until next event.
It's the same for inclusion filter : if it matches an event from the inclusion list, then write log to file until next event.
I had a quick look at your code to see if I could implement this by myself, but haven't understand anything ... I am to bad with python !
Regards,
miljbee
TCP Events : A Better Network Event Sender/Receiver Plugin.
The Network Event Sender/Receiver in C#
Get events in EG from Google Calendar.
TCP Events : A Better Network Event Sender/Receiver Plugin.
The Network Event Sender/Receiver in C#
Get events in EG from Google Calendar.
- Pako
- Plugin Developer
- Posts: 2294
- Joined: Sat Nov 11, 2006 1:31 pm
- Location: Czech Republic
- Contact:
Re: Log redirector
I was some time away from the internet and in the meantime I made some improvements to the plugin.
1) Version 0.0.1
This version has added feature of monitoring the size of the log file.
You can choose the maximum size (max 999 MiB). Once it reached the selected size of the file, file is truncated (of course the latest entries are kept).
The size of the truncated file it is also possible to choose. 2) Version 0.0.2
This version has added the possibility of filtering events. I do not think that this option will be used by many people.
But because it was not difficult to implement this feature, so I did.
There was also changed the unit of file commit interval. Now that figure is in seconds. So be careful when upgrading from version 0.0.0! Pako
1) Version 0.0.1
This version has added feature of monitoring the size of the log file.
You can choose the maximum size (max 999 MiB). Once it reached the selected size of the file, file is truncated (of course the latest entries are kept).
The size of the truncated file it is also possible to choose. 2) Version 0.0.2
This version has added the possibility of filtering events. I do not think that this option will be used by many people.
But because it was not difficult to implement this feature, so I did.
There was also changed the unit of file commit interval. Now that figure is in seconds. So be careful when upgrading from version 0.0.0! Pako
You know flattr ? You can 

Re: Log redirector
Great work Pako !
This plugin will greatly ease my dev/debug sessions.
It's in my tree, and I think it will stay here forever !
Thank You !
This plugin will greatly ease my dev/debug sessions.
It's in my tree, and I think it will stay here forever !
Thank You !
miljbee
TCP Events : A Better Network Event Sender/Receiver Plugin.
The Network Event Sender/Receiver in C#
Get events in EG from Google Calendar.
TCP Events : A Better Network Event Sender/Receiver Plugin.
The Network Event Sender/Receiver in C#
Get events in EG from Google Calendar.
-
- Plugin Developer
- Posts: 2570
- Joined: Sat Jun 30, 2007 2:51 pm
- Location: Stockholm, Sweden
- Contact:
Re: Log redirector
Dear Pako,
I just tried to add the plugin Version 0.0.2 but I got the following error message (using eg 0.4.0 r1397)
Version 0.0.1 works ok
Best regards, Walter
I just tried to add the plugin Version 0.0.2 but I got the following error message (using eg 0.4.0 r1397)
Version 0.0.1 works ok
Best regards, Walter
Code: Select all
08:51:26 Traceback (most recent call last) (1397):
08:51:26 File "C:\Program Files\EventGhost\eg\Classes\TaskletDialog.py", line 59, in ProcessingTask
08:51:26 self.Configure(*args, **kwargs)
08:51:26 File "C:\Program Files\EventGhost\eg\Classes\ConfigDialog.py", line 161, in Configure
08:51:26 treeItem.Configure(*args)
08:51:26 File "C:\Program Files\EventGhost\eg\Classes\ActionItem.py", line 100, in Configure
08:51:26 return self.executable.Configure(*args)
08:51:26 File "C:\Program Files\EventGhost\plugins\LogRedirector\__init__.py", line 728, in Configure
08:51:26 onRadioBox()
08:51:26 File "C:\Program Files\EventGhost\plugins\LogRedirector\__init__.py", line 724, in onRadioBox
08:51:26 onFilterChoice()
08:51:26 File "C:\Program Files\EventGhost\plugins\LogRedirector\__init__.py", line 675, in onFilterChoice
08:51:26 Validation()
08:51:26 File "C:\Program Files\EventGhost\plugins\LogRedirector\__init__.py", line 623, in Validation
08:51:26 flg_1 = len(self.logfile) > 0
08:51:26 TypeError: object of type 'NoneType' has no len()
08:51:26 Traceback (most recent call last) (1397):
08:51:26 File "wx\_core.pyc", line 14618, in <lambda>
08:51:26 File "C:\Program Files\EventGhost\eg\Core.py", line 172, in Notify
08:51:26 listener(value)
08:51:26 File "C:\Program Files\EventGhost\eg\Classes\MainFrame\TreeCtrl.py", line 783, in OnNodeAdded
08:51:26 pos
08:51:26 File "C:\Program Files\EventGhost\eg\Classes\MainFrame\TreeCtrl.py", line 458, in CreateTreeItemAt
08:51:26 return self.CreateTreeItem(node, parentId)
08:51:26 File "C:\Program Files\EventGhost\eg\Classes\MainFrame\TreeCtrl.py", line 446, in CreateTreeItem
08:51:26 node.SetAttributes(self, itemId)
08:51:26 File "C:\Program Files\EventGhost\eg\Classes\PluginItem.py", line 86, in SetAttributes
08:51:26 if self.info.lastException or self.info.initFailed:
08:51:26 AttributeError: 'NoneType' object has no attribute 'lastException'
08:51:26 Traceback (most recent call last) (1397):
08:51:26 File "wx\_core.pyc", line 14618, in <lambda>
08:51:26 File "C:\Program Files\EventGhost\eg\Core.py", line 172, in Notify
08:51:26 listener(value)
08:51:26 File "C:\Program Files\EventGhost\eg\Classes\MainFrame\TreeCtrl.py", line 829, in OnNodeSelected
08:51:26 path = node.GetPath()
08:51:26 File "C:\Program Files\EventGhost\eg\Classes\TreeItem.py", line 354, in GetPath
08:51:26 path.append(parent.childs.index(item))
08:51:26 AttributeError: 'NoneType' object has no attribute 'childs'
My released plugins
https://drive.google.com/drive/folders/ ... y01eVBKeHM
https://drive.google.com/drive/folders/ ... y01eVBKeHM
- Pako
- Plugin Developer
- Posts: 2294
- Joined: Sat Nov 11, 2006 1:31 pm
- Location: Czech Republic
- Contact:
Re: Log redirector
Dear Walter!
Thanks for the warning on a bug. This bug did not show up when you perform an upgrade plugin
(which was already included in the configuration). Therefore, I am about him not knowing.
Now you can download the fixed version 0.0.3.
You'll find it in the first article (on top) of the topic.
Best regards, Pako
Thanks for the warning on a bug. This bug did not show up when you perform an upgrade plugin
(which was already included in the configuration). Therefore, I am about him not knowing.
Now you can download the fixed version 0.0.3.
You'll find it in the first article (on top) of the topic.
Best regards, Pako
You know flattr ? You can 

Re: Log redirector
Pako,
This is great... I wish I had looked for this a while ago... I could have really used it when testing/troubleshooting from a remote PC.
awesome work!
This is great... I wish I had looked for this a while ago... I could have really used it when testing/troubleshooting from a remote PC.
awesome work!
setup... XBMC, W7MC for DVR & Live OTA TV, JRMC for multi-zone audio, EG, MiCasaVerde Vera3, USB-UIRT IR receiver, Harmony remote, 5.2 home theater system
-
- Experienced User
- Posts: 102
- Joined: Wed Feb 17, 2010 2:20 am
Re: Log redirector
Pako
I tried installing the Log Redirector plugin (v.6). I can bring up the config page but I amunable to adjust any of the settings. Any thoughts on what I could try.
Take Care
I tried installing the Log Redirector plugin (v.6). I can bring up the config page but I amunable to adjust any of the settings. Any thoughts on what I could try.
Take Care
- Pako
- Plugin Developer
- Posts: 2294
- Joined: Sat Nov 11, 2006 1:31 pm
- Location: Czech Republic
- Contact:
Re: Log redirector
Maybe there is some error in the plugin, but more likely is that you are doing something incorrectly.ijourneaux wrote:I can bring up the config page but I amunable to adjust any of the settings. Any thoughts on what I could try.
But how can I know what? Maybe a screenshot would help.
Pako
You know flattr ? You can 

-
- Experienced User
- Posts: 102
- Joined: Wed Feb 17, 2010 2:20 am
Re: Log redirector
Sorry Pako. I really didn't give you much to work with. I did figure it out though. At first I didn't understand the logging mode options. I thought the Log EventGhost only meant log eventghost evetns to log file and couldn't figure out why I couldn't specify a file.
Now that I correctly read the options correctly it is clear what you meant
option 1 log eventghost events to eventghost window
option 2 log eventghost events to eventghost window and log file
option 3 log eventghost events to log file
Now that I correctly read the options correctly it is clear what you meant
option 1 log eventghost events to eventghost window
option 2 log eventghost events to eventghost window and log file
option 3 log eventghost events to log file