commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Torsten Curdt <tcu...@vafer.org>
Subject Re: [crypto] Logging dependency
Date Fri, 10 Jun 2016 22:04:04 GMT
> Now we are getting way off topic, but I would argue that a message that
> contains no specific context information would still be a good message.
> There is nothing wrong with a debug message of logger.debug(“User: {},
> userId); as this contains all the context information you need to determine
> where it originated.
>
> Generally it is quite a PITA to constantly have to code:
>
> debug(“Performing action X in method foo in class “ + MyClass.class);
>

1. We are talking about a library.
2. There are ways to access the stack if you really want to



> It is also more expensive since you are doing String concatenation whether
> you want debug messages or not. Logging frameworks exist to a) make logging
> easier and b) to separate generating the log events from what happens with
> them.
>

This is only a problem if you assume to be constantly logging everything -
which you might be a fan of. I am not (for a library).



> The other problem with using a simple debug() construct is that typically
> you will have Application —> library1.method1
> —>library1.method2—>library2.method1—>library3.method1—>debug msg
which
> makes it difficult to determine where the message originated if the message
> only contains general information about the error.


Sorry - don't get that.

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message