logger headerline only when different from last one
Brought to you by:
llongi,
tobidelbruck
This is just a wish for an improvement that I cant figure out myself.
If its a quick fix it would be cool to see.
When starting up jAER or also during runtime one often get many log.info or log.warning messages from the same filter and hence with the same header (except maybe for the time)
It would be awesome if the header line could only be displayed once if the filter is new or a certain time limit has passed, and not everytime.
Example:
May 28, 2014 5:36:05 PM net.sf.jaer.graphics.AEViewer <init> INFO: AEViewer starting up... May 28, 2014 5:36:05 PM net.sf.jaer.graphics.AEViewer <init> INFO: AEChip class name is ch.unizh.ini.jaer.chip.retina.DVS128 May 28, 2014 5:36:06 PM net.sf.jaer.graphics.AEViewer <init> INFO: using C:\Users\Bjoern as the defaultLoggingFolderName May 28, 2014 5:36:06 PM net.sf.jaer.graphics.AEViewer getChipClassPrefs WARNING: building list of all AEChip classses - this takes some time. To reduce startup time, use AEChip/Customize to specify desired classes May 28, 2014 5:36:07 PM net.sf.jaer.util.SubclassFinder findSubclassesOf WARNING: java.lang.NoClassDefFoundError: org/eclipse/swt/widgets/Control while seeing if class net.sf.jaer.chip.AEChip isAssignableFrom class com.jogamp.nativewindow.egl.EGLGraphicsDevice
could be displayed as:
May 28, 2014 5:36:05 PM net.sf.jaer.graphics.AEViewer <init> INFO: AEViewer starting up... INFO: AEChip class name is ch.unizh.ini.jaer.chip.retina.DVS128 INFO: using C:\Users\Bjoern as the defaultLoggingFolderName WARNING: building list of all AEChip classses - this takes some time. To reduce startup time, use AEChip/Customize to specify desired classes May 28, 2014 5:36:07 PM net.sf.jaer.util.SubclassFinder findSubclassesOf WARNING: java.lang.NoClassDefFoundError: org/eclipse/swt/widgets/Control while seeing if class net.sf.jaer.chip.AEChip isAssignableFrom class com.jogamp.nativewindow.egl.EGLGraphicsDevice
This would make the whole logging business a lot more usefull as currently it is almost unbearable to read the logs in any meaningful way.
Log messages are done through the java.util.logging framework right now, and I haven't found anything that would enable this with it. Each log messages can be formatted and so on, but they are separate from each other and know nothing about each other. It might be possible by rewriting entire parts of the logging handlers to add some kind of global state, but I think time would be more worthwhile to invest into making the log messages clearer and more informative where needed, and setting appropriate logging levels for the really noisy ones.
This would be possible if someone would invest effort in a custom Logger. It's a nice idea but we don't have the resource to invest effort in it. It is certainly possible with a stateful Logger rather than the default logging handlers that we have now (logging to System.out and console and log files).