Java Logger - "No line break" and "explicit class logging" problem -
I am currently struggling with two problems about java.util.logging.Logger: 1) I want to There should be a (feature) method like "notification () / fine ()" methods, only that method should not include a line break after the output (such as functionality like System.out.print and println). I have already overridden the format () method - will it be denoted to add "no-linebreak-flag" to the log record and to analyze it in format, or it will be very slow (because I use real-time applications ". So what would be the right way to get sthg?
2) Currently I have a factory class that creates the desired logger (I end up between file logging and console logging ) - But I can not really find out how to log in detail the package / classes ("module") and who does not. Or I want to check the debug flag in each category and then either Logger (debug == true) or not? I would like to have all the necessary settings through the source code and if possible, do not have a logging-property file ...
I've been a little late logger To the left <^ P> On # 2 - You must notify everyone In the login config file the ion's entire point is that you can 'slice' things out of your code and properties in the outside of your code.
Actually - you always call logger.bug () in your code, and if logging is configured to debug messages, you will not see output from the hem
I have seen code like
if (logger.debugenabled ()) {logger.debug (); }
And when I inquired about it, then people have said that they are not delivering the Lojor. Debug Call My humble opinion is that it is only relevant to a small proportion of applications, and you should probably leave Logger. Debug calls, and logging structures should take care of it.
Oh - and I examined the source code for the console appender It seems that the new line is hard.
for (int i = 0; i
Comments
Post a Comment