Re: [opensc-devel] debug code rewrite

2010-03-16 Thread Martin Paljak
On Mar 16, 2010, at 21:52 , Andreas Jellinghaus wrote: > Am Dienstag 16 März 2010 18:04:50 schrieb Martin Paljak: >>> Maybe we should have a uniform handling for all tools? >>> It is strange if one tool does this, and the others don't. >> >> The problem with stderr and stdout is that tools also wr

Re: [opensc-devel] debug code rewrite

2010-03-16 Thread Andreas Jellinghaus
Am Dienstag 16 März 2010 18:04:50 schrieb Martin Paljak: > > Maybe we should have a uniform handling for all tools? > > It is strange if one tool does this, and the others don't. > > The problem with stderr and stdout is that tools also write independently > to those files. What makes it hard to

Re: [opensc-devel] debug code rewrite

2010-03-16 Thread Martin Paljak
On Mar 16, 2010, at 18:46 , Andreas Jellinghaus wrote: > Am Dienstag 16 März 2010 17:36:31 schrieb Viktor TARASOV: >> is it wanted that now, when using 'pkcs15-init' tool, >> the more-then-once-verbose debug log goes onto 'stderr' ? > > a...@yomigaeri:~/projects/opensc/opensc/src/tools$ grep debug

Re: [opensc-devel] debug code rewrite

2010-03-16 Thread Andreas Jellinghaus
Am Dienstag 16 März 2010 17:36:31 schrieb Viktor TARASOV: > is it wanted that now, when using 'pkcs15-init' tool, > the more-then-once-verbose debug log goes onto 'stderr' ? a...@yomigaeri:~/projects/opensc/opensc/src/tools$ grep debug_file *.c opensc-explorer.c: ctx->debug_fi

Re: [opensc-devel] debug code rewrite

2010-03-16 Thread Viktor TARASOV
Hello Andreas, is it wanted that now, when using 'pkcs15-init' tool, the more-then-once-verbose debug log goes onto 'stderr' ? Kind wishes, Viktor. -- Viktor Tarasov ___ opensc-devel mailing list opensc-devel@lists.opensc-project.org http://www.ope

Re: [opensc-devel] debug code rewrite

2010-03-16 Thread Viktor TARASOV
Hi, Andreas Jellinghaus wrote: > we discussed this in the past, and the general consensus seems to > improve the debug/logging code. > My point of view is quite on-sided . Simplifying a little bit, from my 'developer' point of view there are two contradicting aspirations, from one side redu

Re: [opensc-devel] debug code rewrite

2010-03-15 Thread Martin Paljak
On Mar 15, 2010, at 16:51 , Andreas Jellinghaus wrote: > Am Montag 15 März 2010 14:26:53 schrieb Martin Paljak: >> On Mar 14, 2010, at 16:25 , Andreas Jellinghaus wrote: >>> So please have a look at attached diff. If there are no objects, I would >>> like to apply it. Further improvement can then b

Re: [opensc-devel] debug code rewrite

2010-03-15 Thread Martin Paljak
On Mar 15, 2010, at 12:59 , Andreas Jellinghaus wrote: >> IMHO it is also important to have a difference in logging (which is usually >> done in long-running applications) and piping debug information to >> somewhere. OpenSC seems to fall into the latter category. As the name >> implies, sc_debug d

Re: [opensc-devel] debug code rewrite

2010-03-15 Thread Andreas Jellinghaus
Am Montag 15 März 2010 13:17:00 schrieb Martin Paljak: > I wrote: > "Instead of trying to categorize debug statements with code constants it > would be better to *agree on some common levels for common tasks and > document it and follow it*." this still reads to me as a very vague concept. why c

Re: [opensc-devel] debug code rewrite

2010-03-15 Thread Andreas Jellinghaus
Am Montag 15 März 2010 14:26:53 schrieb Martin Paljak: > On Mar 14, 2010, at 16:25 , Andreas Jellinghaus wrote: > > So please have a look at attached diff. If there are no objects, I would > > like to apply it. Further improvement can then be made by everyone. > > If posting a patch (especially on

Re: [opensc-devel] debug code rewrite

2010-03-15 Thread Andreas Jellinghaus
Am Montag 15 März 2010 07:38:45 schrieb Martin Paljak: > For example, in the > probably most common scenario (inside a function, after checking some > return code) the essence of the debug call - the message itself - starts > on column 53 (with tab size 8). yes, small messages fit on the same

Re: [opensc-devel] debug code rewrite

2010-03-15 Thread Martin Paljak
On Mar 14, 2010, at 16:25 , Andreas Jellinghaus wrote: > So please have a look at attached diff. If there are no objects, I would > like to apply it. Further improvement can then be made by everyone. If posting a patch (especially one that goes through every single source file) to the list in the

Re: [opensc-devel] debug code rewrite

2010-03-15 Thread Martin Paljak
Hello, On Mar 15, 2010, at 13:13 , Andreas Jellinghaus wrote: > Am Montag 15 März 2010 07:38:45 schrieb Martin Paljak: >> Encoding the common levels as wrapper functions or macros like >> sc_debug1/SC_DEBUG1 would also be a solution > > if we use arbitrary values, we could be back to the old code

Re: [opensc-devel] debug code rewrite

2010-03-15 Thread Andreas Jellinghaus
Am Montag 15 März 2010 07:38:45 schrieb Martin Paljak: > Encoding the common levels as wrapper functions or macros like > sc_debug1/SC_DEBUG1 would also be a solution if we use arbitrary values, we could be back to the old code: different numbers used in different places, but no guideline what sh

Re: [opensc-devel] debug code rewrite

2010-03-15 Thread Andreas Jellinghaus
Am Montag 15 März 2010 07:38:45 schrieb Martin Paljak: > Shortening the constants is not the real solution either. but if we want to do that, sed will be our friend, so I don't think its a show stopper right now. > Encoding the common levels as wrapper functions or macros like > sc_debug1/SC_DEB

Re: [opensc-devel] debug code rewrite

2010-03-14 Thread Martin Paljak
Hello, On Mar 14, 2010, at 16:25 , Andreas Jellinghaus wrote: > here is what I did so far: > * removed SC_LOG_TYPE_DEBUG - we only have this type, so no need for it. > * removed _sc_debug - was only used internally, call sc_do_log directly. > * removed sc_do_log_va - was only used internally and i