Page 2 of 3

Re: EventGhost Application Control Plugin

Posted: Wed Nov 14, 2012 7:38 pm
by phlox
Here we go... EG App Control plugin version 0.2.0 released
(download in the first post)

Change log:

Code: Select all

# 0.2.0    Added action 'EventOnLogEntry': 
#            Fires an event when a monitored log entry occurs
#          Changed displayed plugin name: "EventGhost Application Control" -> "EG App Control"
Sample configuration for the new action 'EventOnLogEntry':
FireEventOnLogEntry settings.png
This might be used as follows:
sample config.png
Let me know if you encounter problems or if it works all right for you.

Re: EventGhost Application Control Plugin

Posted: Fri Nov 16, 2012 8:19 am
by blaher
It works really well, thanks. :) Is there a way to monitor the yellow triangular exclamation point warnings, like the ones you get if you uninstall the win 7 MCE remote service, (or it crashes, of course, that's the practical application)?

Thanks again, this is most beneficial and should be a part of EG by by default.

Re: EventGhost Application Control Plugin

Posted: Fri Nov 16, 2012 4:37 pm
by phlox
blaher wrote:It works really well, thanks. :)
glad to hear, thanks :)
blaher wrote:Is there a way to monitor the yellow triangular exclamation point warnings ...
yep, already implemented in version 0.2.1 - download in the first post

Re: EventGhost Application Control Plugin

Posted: Mon Nov 19, 2012 5:02 am
by blaher
Thank you, that works very well too. :)

Re: EventGhost Application Control Plugin

Posted: Sat Jan 12, 2013 6:49 am
by blaher
For some reason the plugin is not firing an event in the instance I've posted below. Can you see what I've done wrong? It works on some errors, just not all, it seems.

Cheers.

Re: EventGhost Application Control Plugin

Posted: Sat Jan 12, 2013 9:07 am
by phlox
Strange... first I thought: unchecking the 'Fire only once' checkbox would solve the problem. But actually I think it won't, because you restart EG after the error occured, therefore the action always catches the first occurence.

Does EG hang after that error? I guess yes, because you want to restart it afterwards. And that could be the problem: If EG is completely in misery, it is maybe not even able to fire your 'Error' event. Maybe you find an earlier symptom to monitor before this plugin causes a crash? And, of course, the best thing would be to fix this plugin...

If you want, you could run 'eventghost.exe -debug' and send me the log file after the next time it happened, maybe I see a bit more in the traces of the log.

Re: EventGhost Application Control Plugin

Posted: Sat Jan 12, 2013 4:01 pm
by Livin
phylox,
I thought of a features that would be VERY useful to many here, if you could add it...

Parse the text string from the log and place a portion of it in an EG variable.

current example from Owel on another thread... the log shows a command received, in this case a volume level... HTTP.Volume[u'40']

He wants to extract the "40" and place it into another command to send such as... MVL40

If you plugin provided an easy way to do this and place it in a variable, that would be fantastic. I know a lot of users use/need this functionality and you plugin seems like the proper place for it given it is already doing the log reading and event triggering part.

Re: EventGhost Application Control Plugin

Posted: Sat Jan 12, 2013 7:46 pm
by phlox
Yes, I think that should be easy possible. I'm just thinking about how to make it self-explaining and easy to use on one hand and allowing flexibility on the other hand.

I could modify the existing action 'Fire Event On Log Entry'.
- First of all, rename it to 'Log Monitor'
- Leave the upper box "Monitor log message" as is
- Rename the lower box to "Action when found"
- The new GUI could look like this:

Code: Select all

----- Monitor log message -------------------------------
Catch log message ___________________________________
                  [ ] Case sensitive
                  [ ] Whole line

Monitor log messages of type
[x] Error
[x] Warning
[x] Information
[ ] Action
[ ] Macro
[ ] Event

----- Clip the log message ------------------------------
(o) Extract the text between character ___ and ___ (e.g. " and ")
( ) Extract the text between position ___ and ___ (e.g. 27 and 32)
( ) Extract numeric value (e.g. find "40" in "HTTP.Volume[u'40']")
( ) Apply a regular expression ___________________________
( ) Keep the full log message as is

----- Action when found ---------------------------------
[x] Fire an event
    Event name __________________________
               [ ] Fire only once (until next call of this action)
    The clipped log message will be accessible as payload of the event

[x] Set a variable
    Variable name: eg.globals.____________________

[ ] Print the clipped log message

What do you think? Suggestions, ideas? Would someone, who speaks better English than me, correct/improve the labels?

Re: EventGhost Application Control Plugin

Posted: Sat Jan 12, 2013 10:46 pm
by Livin
That looks good.

Other very useful parameters are...

"Start search AFTER these characters":__________
-- look for these specific characters, then start searching. In case you don't know where in the string the characters you are looking for will be

"Start searching AFTER character number __ from the left"
-- start the match 5 characters in. In case you know what you are looking for will be at the same location every time

"Grab __ number of Characters AFTER the starting point"
... in case they don't know what characters they are looking for...

Example: If you are trying to pull a specific characters, like "HA" or any given numerals - they could be in the string one of more times... so having a set of characters to look for after , then pulling your search string from the characters after it will help reduce possibility of grabbing the wrong

Re: EventGhost Application Control Plugin

Posted: Sun Jan 13, 2013 6:46 am
by blaher
phlox wrote:Does EG hang after that error?
No, EG is fine. It just stops monitoring my home automation program (Z-Wave Vera), until it is restarted. Your program is really helpful.
If you want, you could run 'eventghost.exe -debug' and send me the log file after the next time it happened, maybe I see a bit more in the traces of the log.
OK, it's running in debug mode now. I can't see a log file, but I'll deal with that when it happens again. :)

Re: EventGhost Application Control Plugin

Posted: Sun Jan 13, 2013 10:42 am
by phlox
Livin wrote: Other very useful parameters are...
That makes sense. Let's go for it - it's the perfect task for a winter sunday...

Re: EventGhost Application Control Plugin

Posted: Sun Jan 13, 2013 10:45 am
by phlox
blaher wrote:OK, it's running in debug mode now. I can't see a log file, but I'll deal with that when it happens again. :)
yes, that log file is quite a bit hidden. In Win7, you find it in C:\Users\<Name>\AppData\Roaming\EventGhost\Log.txt

Re: EventGhost Application Control Plugin

Posted: Sun Jan 13, 2013 3:49 pm
by Livin
phlox wrote:
blaher wrote:OK, it's running in debug mode now. I can't see a log file, but I'll deal with that when it happens again. :)
yes, that log file is quite a bit hidden. In Win7, you find it in C:\Users\<Name>\AppData\Roaming\EventGhost\Log.txt
Install a plugin called "Log Redirector" and you can have it write a copy of the log entries anywhere you want. I use it and it is a perfect way to make the log more accessible, and have a duplicate if you need a backup for some reason.

Log Redirector... viewtopic.php?f=9&t=2852

Re: EventGhost Application Control Plugin

Posted: Mon Jan 14, 2013 6:12 pm
by phlox
Livin wrote:Log Redirector... viewtopic.php?f=9&t=2852
That plugin is very handy indeed, I use it all days, but correct me if I'm wrong, I think it's not the same as the '-debug' option of eventghost.exe. Log Redirector writes the Screen Log into a file, while '-debug' creates a debug log file which is saved under AppData\Roaming\EventGhost. I wish strongly that the debug log would also contain the screen log (at least: called macros, actions and events), that would vastly simplify debugging. Maybe Pako is reading as well - what do you think?

Btw, I'm in the middle of implementing the new functionality, but it's always the same, other duties don't allow me big jumps...

Re: EventGhost Application Control Plugin

Posted: Fri Jan 18, 2013 10:50 pm
by phlox
hi there

here's a first beta of the extended 'Log Monitor' action.

The config screen looks now like this:
grab_data.png
More documentation can be found in the 'Log Monitor' action.

Notes:
  • The action 'Log Monitor' is not backward compatible with the previous version 'EventOnLogEntry' since I refactored it completely. You have to remove calls of 'EventOnLogEntry' and add 'Log Monitor' again.
  • The new version also fixes the bug (found in 0.2.1, reported by blaher) that log monitoring stopped when the application window was minimized.
  • I did not yet implement the proposed 'Start searching AFTER ...' options. Please try with the current implementation if you can achieve what you desire. If not, let me know. But I think with the given modes, especially with the regex mode, you can achieve almost everything.
Any feedback is welcome.

Edit: attachment removed since obsolete.