On Mar 17, 2010, at 10:27 , Ludovic Rousseau wrote:
> 2010/3/17 Martin Paljak <mar...@paljak.pri.ee>:
>> On Mar 16, 2010, at 21:57 , Andreas Jellinghaus wrote:
>>> Am Dienstag 16 März 2010 18:08:44 schrieb Martin Paljak:
>>> 
>>> please: no compile time setting. that way distributions will always compile
>>> it the wrong way and generate the logs with too little or too much
>>> information. it wouldn't be hard to make it runtime configureable...
>> That's why I'm reluctant to make it easily changeable, via whatever method, 
>> the worst being a "user definable" (compare to debug level 99 "chicken 
>> sacrifice myth")
>> 
>> Eventually the distributions do what they think is right if the information 
>> is available about "what is right" and if they still do something that has a 
>> "DO NOT DO THIS" sign attached, they probably have a very good reason.
>> 
>> For me, the log format is OK, but a small script snippet in the wiki to 
>> remove the verbose information that makes diffing complicated would be a 
>> nice extra.
>> 
>> An undocumented #define to tweak the log output in "developer mode" would 
>> also be an option.
> 
> Another solution I use for pcsc-lite and libccid is to use an
> environment variable like PCSCLITE_DEBUG to activate debug in
> libpcsclite.
> - The user do not have to be root and edit a configuration file.
> - The user do not have to change a configuration file back to normal
> - The configuration is only for one use in one shell. Not for the
> entire system (in a multi-user system)
The reason for a file is simple: it is easy to understand and use in cases like 
Windows or PKCS#11 applications, where the user (and I really mean a "user") 
can grasp the concept of "edit this file there, pick up the result from the 
location set in the file"


> We could have the same for OpenSC. Something like:
> $ export OPENSC_DEBUG=devel
> to suppress time and line numbers.


There's already OPENSC_DEBUG, see 
http://www.opensc-project.org/opensc/wiki/EnvironmentVariables#OPENSC_DEBUG
There could be OPENSC_DEBUG_FILE as well, patch attached. 

Attachment: logenv.diff
Description: Binary data



Ability to change the format via a environment would be an additional step. I 
don't think that there should be any specialized machinery to allow 
super-flexible log format configuration or log4c.
I personally don't mind the line numbers either, as it is always possible to 
remove them with sed/awk. But if somebody wants to make some flexible hackery 
for this, why not.

-- 
Martin Paljak
http://martin.paljak.pri.ee
+3725156495


_______________________________________________
opensc-devel mailing list
opensc-devel@lists.opensc-project.org
http://www.opensc-project.org/mailman/listinfo/opensc-devel

Reply via email to