Closed laneb closed 5 years ago
Missed that smv.dsm.TX
was logging through log4j using a different strategy. Will migrate that to use smv.logger
as well.
Short term, user sets log level and other logging configuration programmatically (e.g. smv.logger.setLevel("DEBUG")
). I created #1517 to let SMV load logging conf from file using logging.config.fromFile
.
Tying logging to SmvApp
requires the injecting the SmvApp
(whether by constructor or by SmvApp.getInstance
) into places where it is otherwise not needed. This previously made sense because we couldn't log without an SmvApp
to connect us to the JVM, but it's no longer necessary. It will be simpler to add new logging to an arbitrary function if it doesn't need to be tied to SmvApp
. Could leave the existing log statements going through SmvApp
, but didn't want to maintain 2 patterns for logging. By "less changes" do you mean to reduce the size of the PR?
Got it, makes sense. merging.
Resolves #1512.
Replaces log4j logger with Python standard logger for all logging in SMV:
logging
library and make it available for import atsmv.logger
smv.logger
instead of theSmvApp
loggerRemoving the cost of py4j from logging improves the latency of
get_graph_json
for a 1000 module project by over 50%. For now logging levels and other configuration will need to be adjusted through code (e.g.smv.logger.setLevel("DEBUG")
).logging
supports configuration via yaml, so I created #1517 to load a custom config provided by users.