[BRLTTY] New logging functionality.

Dave Mielke dave at mielke.cc
Sat May 26 12:04:05 EDT 2012


[quoted lines by Nicolas Pitre on 2012/05/26 at 23:31 +0800]

>One notable absence in those categories appears to be "speech".  
>However it is hard to introduce speech event logging as the speech 
>driver methods are directly called from all over the place e.g. 
>speech->say(...).  It would probably make sense to wrap those calls with 
>a common function like speech_say(...) and so on for all speech methods, 
>and have speech->say() be called only from there.  Then, logging speech 
>events becomes trivial.

Yes, this should be done for sure.

>Secondly, looking at logRouting(), it might be a good idea to push 
>vsprintf usage down into logMessage(), or alternatively to move the log 
>level test up, so to avoid wasted CPU cycles doing string formatting if 
>the log level is too low and the formatted string won't be used in the 
>end.
>
>This could in fact be combined into a single bit mask:
>
>#define LOG_LVL_EMERGENCY	(1 << 0)
...

That won't work because it's important to keep the log level value so that it 
can be passed to syslog.

logMessage() already passes it's work to a lower level. The work is really all 
done in logData(). All we need to do is to have logRouting() do it the same 
way. Another candidate would be the logging of key events since they must be 
fast.

-- 
Dave Mielke           | 2213 Fox Crescent | The Bible is the very Word of God.
Phone: 1-613-726-0014 | Ottawa, Ontario   | 2011 May 21 is the End of Salvation.
EMail: dave at mielke.cc | Canada  K2A 1H7   | http://Mielke.cc/now.html
http://FamilyRadio.com/                   | http://Mielke.cc/bible/


More information about the BRLTTY mailing list