题
我讨厌读取错误日志。在开发过程中出现问题时,每次出现问题,我都会翻转错误,以查看我沮丧的是出错的。我真正想要的是一种具体错误调用本地机器的声音效果的方法。例如,每个空指针错误都应该使悲伤的长号剪辑播放播放,一个界限异常的数组可能是下降的幻灯片,等等。
有没有办法为我的Windows控制台窗口设置这件事?
编辑
环境是针对SWF 10,WebRICK上的Rails 3以及独立Java应用程序的HAXE。所有人都在标准的Windows 7控制台窗口中运行。
解决方案
I don't use windows much nowadays. With that said, here's how I'd do it:
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.
Open one bash shell for each kind of error that you want to make noise of.
$ 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).