|
View:
New views
4 Messages
—
Rating Filter:
Alert me
|
|
|
Audio Debug Logs for Catalyst: Catalyst::TraitFor::Log::AudioI just created a simple trait for the Catalyst::Log that uses OS X's 'say' utility to log error messages to audio, such that the computer will say them to you. My eyes tire of reading through 100s of lines of debug output, so now sometimes I will have the computer simply talk to me.
Its not in CPAN yet, but its simple enough: ------- package Catalyst::TraitFor::Log::Audio; use Moose::Role; sub speak { my ($self, $txt) = @_; return unless $txt; system("say $txt &") if $ENV{'SPEAK'}; } 1; ----- In MyApp.pm, after setup(): Moose::Util::apply_all_roles(MyApp->log, 'Catalyst::TraitFor::Log::Audio'); ---- In a controller: $foo='bar'; $c->log->speak('Hello world, the value of foo is $foo'); --- If ENV 'SPEAK' is set, it will talk to you. Works like a charm. mst/t0m told me how to do it. Will get around to CPAN'ing it this week. Anyone aware of a cross platform library that will do this kind of speech stuff? There is no reason to stop here if this is useful to people - could play tones depending on state, warnings, etc. Russell Jurney russell.jurney@... _______________________________________________ List: Catalyst@... Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@.../ Dev site: http://dev.catalyst.perl.org/ |
|
|
Re: Audio Debug Logs for Catalyst: Catalyst::TraitFor::Log::Audio2009/7/1 Russell Jurney <russell.jurney@...>:
> I just created a simple trait for the Catalyst::Log that uses OS X's 'say' > utility to log error messages to audio, such that the computer will say them > to you. My eyes tire of reading through 100s of lines of debug output, so > now sometimes I will have the computer simply talk to me. Top tip: making a noise is incredibly useful for test and small-audience servers. Whenever anything goes wrong, make the computer make a sound, and you can ask whoever has a problem straight away what they were doing, etc. - before they forget, and often while they're still trying to work out what to do. (The server we had that did this coughed discreetly when a problem came up. This was great until the winter cold season came on...) -- Ian. _______________________________________________ List: Catalyst@... Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@.../ Dev site: http://dev.catalyst.perl.org/ |
|
|
Re: Audio Debug Logs for Catalyst: Catalyst::TraitFor::Log::AudioYes, it also helps me determine the state of my controllers in the
test server without straining my eyes reading the debug output. And I have MyApp.pm system("say 'go' &"); also, which tells me that the test server just reloaded the content and the server is ready for testing again, each time I save a file and it auto-restarts. Before I would have to change windows and watch it until I saw that it was ready. Its actually quite pleasant :) Russell Jurney russell.jurney@... On Jul 1, 2009, at 10:20 AM, Ian Wells wrote: > 2009/7/1 Russell Jurney <russell.jurney@...>: >> I just created a simple trait for the Catalyst::Log that uses OS >> X's 'say' >> utility to log error messages to audio, such that the computer will >> say them >> to you. My eyes tire of reading through 100s of lines of debug >> output, so >> now sometimes I will have the computer simply talk to me. > > Top tip: making a noise is incredibly useful for test and > small-audience servers. Whenever anything goes wrong, make the > computer make a sound, and you can ask whoever has a problem straight > away what they were doing, etc. - before they forget, and often while > they're still trying to work out what to do. > > (The server we had that did this coughed discreetly when a problem > came up. This was great until the winter cold season came on...) > > -- > Ian. > > _______________________________________________ > List: Catalyst@... > Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst > Searchable archive: http://www.mail-archive.com/catalyst@.../ > Dev site: http://dev.catalyst.perl.org/ _______________________________________________ List: Catalyst@... Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@.../ Dev site: http://dev.catalyst.perl.org/ |
|
|
Re: Audio Debug Logs for Catalyst: Catalyst::TraitFor::Log::AudioOh, btw - its up on CPAN now: http://search.cpan.org/~rjurney/Catalyst-TraitFor-Log-Audio-0.01/lib/Catalyst/TraitFor/Log/Audio.pm
I'll add Linux support and queueing soon. Russell Jurney russell.jurney@... On Jul 1, 2009, at 10:20 AM, Ian Wells wrote: > 2009/7/1 Russell Jurney <russell.jurney@...>: >> I just created a simple trait for the Catalyst::Log that uses OS >> X's 'say' >> utility to log error messages to audio, such that the computer will >> say them >> to you. My eyes tire of reading through 100s of lines of debug >> output, so >> now sometimes I will have the computer simply talk to me. > > Top tip: making a noise is incredibly useful for test and > small-audience servers. Whenever anything goes wrong, make the > computer make a sound, and you can ask whoever has a problem straight > away what they were doing, etc. - before they forget, and often while > they're still trying to work out what to do. > > (The server we had that did this coughed discreetly when a problem > came up. This was great until the winter cold season came on...) > > -- > Ian. > > _______________________________________________ > List: Catalyst@... > Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst > Searchable archive: http://www.mail-archive.com/catalyst@.../ > Dev site: http://dev.catalyst.perl.org/ _______________________________________________ List: Catalyst@... Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@.../ Dev site: http://dev.catalyst.perl.org/ |
| Free embeddable forum powered by Nabble | Forum Help |