Menu

#913 autoplot logging is verbose and inconsistent

nextrelease
closed
nobody
None
5
2018-09-28
2012-09-15
No

Reiner noted that Autoplot is too verbose, sending a log containing messages like:
INFO: skipping property "componentAutomatically" of PlotElement, failed to find read and write method. and
WARNING: xaxis isn't sized, loading data at full resolution!

Logging is done inconsistently throughout, and this needs to be tidied up. The following rules should be used:
1. System.err.println should never be used in a production release. Netbeans allows breakpoints with custom messages that make it so debug printlns should be unnecessary and less productive, because they can be added to a running session: "setRenderType {=renderType.toString()}" I will make a hudson test that greps for all printlns in committed code.
2. Messages that are part of normal operations but would not be of interest to the end user should be logged at Level.FINE or less.
3. Messages that are of interest to the end user ("plot selected") should be logged at FINE and indicated on the screen.
4. Batch scripts should not show messages intended for interactive use, like "plot selected". Users running batch scripts can set the log levels to be more verbose while developing.
5. A controlled hierarchical namespace of log channels must be developed and followed. e.g. currently TimeSeriesBrowseController sends messages to "ap.tsb" and AutoplotUI sends to "org.virbo.autoplot".
6. The console GUI should be have somewhat finer control of the log channels, for example a GUI that shows all the channels that have been used and allows setting the verbosity of each branch. I'm always shocked that there are apparently no tools for doing this already.

Discussion

  • Jeremy Faden

    Jeremy Faden - 2012-09-15

    Start to develop hierarchy. This is the top level:
    "das2" messages from the das2 graphics subsystem. This has a developed namespace and I wouldn't want to mess with it.
    "qdataset" messages with data handling. data operations. qstream handling.
    "datum" parsing and formatting. math.
    "apdss" autoplot data source messages
    "autoplot" autoplot application, applet, testing

    Note here's a way to look at all the channels being used: Go to the top level of Autoplot source code, above "VirboAutoplot" and "dasCore". Then:
    ~/temp/autoplot2011
    spot5> find . -name '*.java' -exec grep "Logger.getLogger" {} \; | grep -v "class.getName()"

     
  • Jeremy Faden

    Jeremy Faden - 2012-09-15
     
  • Jeremy Faden

    Jeremy Faden - 2012-11-09

    This has been very effective, and I find it easier to use the loggers now.

     
  • Jeremy Faden

    Jeremy Faden - 2012-11-09

    In a number of places legacy logging is still done, and this needs to be cleaned up. Also the GUI for setting log levels should be a tree instead of a list, because it's getting quite long.

     
  • Jeremy Faden

    Jeremy Faden - 2017-05-24
    • status: open --> closed
    • Group: --> nextrelease
     
  • Jeremy Faden

    Jeremy Faden - 2018-07-20

    A couple of things I've thought about in the years since:
    1. most loggers come from a class we control, LoggerManager.getLogger.
    2. it would be nice to be able to sort the loggers by last message time. I doubt this would affect performance, and would be a nice option.
    3. a tree table view would be useful.
    4. Ivar suggested color-coding loggers to identify the source of messages.
    5. the "highlite lines matching" feature also keeps the stack trace when the message was issued. This is also effective, and it would be nice to make this feature accessible to others.

     
  • Jeremy Faden

    Jeremy Faden - 2018-09-28