Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Catalyst: Users
Audio Debug Logs for Catalyst: Catalyst::TraitFor::Log::Audio
 

Index | Next | Previous | View Flat


russell.jurney at gmail

Jul 1, 2009, 2:15 AM


Views: 566
Permalink
Audio Debug Logs for Catalyst: Catalyst::TraitFor::Log::Audio

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.

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[at]gmail.com

Subject User Time
Audio Debug Logs for Catalyst: Catalyst::TraitFor::Log::Audio russell.jurney at gmail Jul 1, 2009, 2:15 AM
    Audio Debug Logs for Catalyst: Catalyst::TraitFor::Log::Audio russell.jurney at gmail Jul 1, 2009, 2:20 AM
        Re: Audio Debug Logs for Catalyst: Catalyst::TraitFor::Log::Audio ijw at cack Jul 1, 2009, 7:20 AM
    Re: Audio Debug Logs for Catalyst: Catalyst::TraitFor::Log::Audio russell.jurney at gmail Jul 1, 2009, 5:15 PM
    Re: Audio Debug Logs for Catalyst: Catalyst::TraitFor::Log::Audio russell.jurney at gmail Jul 1, 2009, 5:16 PM

  Index | Next | Previous | View Flat
 
 


Interested in having your list archived? Contact lists@gossamer-threads.com
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.