pre print_log code hook?

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

pre print_log code hook?

brian mckissick
Hi Bruce/All,

I use the pre speak code hook for several things, like selectively
forwarding speak data based on certain substrings being present. (For
example, any string starting with "Urgent:" or "Call from" will
forward to my pager, etc...) It is also useful in troubleshooting
sometimes - you can copy the data to a seperate logfile which doesn't
get rotated out, etc.

However, there are other cases where I would like to be able to do the
same but using print_log data. For example, when the CM11 locks up, I
send a "reset X10" instruction to a Basic Stamp/TW523 so that it puts
a command onto the powerline to "un-lockup" the CM11. This works well,
but I have to insert my code inline into the CM11 pm every new
version. If there were a code hook location at the start of print_log,
then I could just have a user codefile which attaches there and looks
for the X10 timeout/reset printf. You could also (for example) copy
all occurrances of pauses/whatever to a logfile to reduce the need to
manually go through the main mh logfile, etc...

After that way-too-long buildup, my question is: would it be practical
for a code hook location to be added in print_log? One day I plan to
try it, but I've been saying that for ~ a year now, and still haven't
gotten to it, so if anyone else thinks it would be useful and/or has
reasons why it wouldn't be worth pursuing....

Thanks, Brian


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
<a href="http://sel.as-us.falkag.net/sel?cmd=lnk&kid3432&bid#0486&dat1642">http://sel.as-us.falkag.net/sel?cmd=lnk&kid3432&bid#0486&dat1642
________________________________________________________
To unsubscribe from this list, go to: <a href="http://sourceforge.net/mail/?group_id65">http://sourceforge.net/mail/?group_id65

Reply | Threaded
Open this post in threaded view
|

Re: pre print_log code hook?

Bruce Winter
brian mckissick wrote:

> After that way-too-long buildup, my question is: would it be practical
> for a code hook location to be added in print_log?

Sure, seems like a good idea.   I'll get to that tomorrow, so it will be
in the 2.101 release on Sunday.

Bruce


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
________________________________________________________
To unsubscribe from this list, go to: http://sourceforge.net/mail/?group_id=1365

Reply | Threaded
Open this post in threaded view
|

Re: pre print_log code hook?

Bruce Winter
Bruce Winter wrote:
> brian mckissick wrote:
>
>> After that way-too-long buildup, my question is: would it be practical
>> for a code hook location to be added in print_log?
>
>
> Sure, seems like a good idea.   I'll get to that tomorrow, so it will be
> in the 2.101 release on Sunday.

Silly me.  We already have a code hook in print_log.  Try this:

-----
&Log_add_hook(\&my_log) if $Reload;

sub my_log {
     my ($mode)  = shift @_;
     my ($text)  = shift @_;
     my (%parms) = @_;
     print "mode=$mode text=$text\n";
}
----

mode will be display, print_log, play, or speak.

Bruce


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
________________________________________________________
To unsubscribe from this list, go to: http://sourceforge.net/mail/?group_id=1365