开发者

Error log sound effects?

开发者 https://www.devze.com 2023-02-11 18:09 出处:网络
I hate reading error logs.Every time something goes wrong during development and I flip over to the error log up to see what\'s gone wrong I\'m depressed.What I really want is a way to have specific e

I hate reading error logs. Every time something goes wrong during development and I flip over to the error log up to see what's gone wrong I'm depressed. What I really want is a way to have specific errors invoke sound开发者_开发知识库 effects on my local machine. For example, every null pointer error should make the sad trombone clip play, an array out of bounds exception could be a falling slide whistle, and so on.

Is there a way to set this up for my Windows console window?

Edit

Environments are Haxe targeting SWF 10, Rails 3 on Webrick, and a standalone Java application. All run in a standard Windows 7 console window.


I don't use windows much nowadays. With that said, here's how I'd do it:

  1. Download and install cygwin, just to get bash and basic unix utilities, specifically, tail and grep. Those three should be enough to do the job, plus a $sound_player. You might be able to bypass cygwin and install bash, tail and grep independently.

  2. Open one bash shell for each kind of error that you want to make noise of.

  3. $ while tail -f $LOGFILE|grep $ERROR_MESSAGE; do $sound_player $SOUND_FILE; done

There should be a way to do the equivalent of the above using the windows shell (cmd).

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号