837 | @@ -837,9 +838,16 @@ def _start_logging(self):
838 | # User can provide log level as a number or string (eg DEBUG). loglevel was caught as a string, so try to convert it to an int
839 | ll = int(self.options.loglevel) if self.options.loglevel.isdigit() else self.options.loglevel.upper()
840 | ch.setLevel(ll)
841 | +
842 | # Format logs the same as bitcoind's debug.log with microprecision (so log files can be concatenated and sorted)
843 | - formatter = logging.Formatter(fmt='%(asctime)s.%(msecs)03d000Z %(name)s (%(levelname)s): %(message)s', datefmt='%Y-%m-%dT%H:%M:%S')
844 | - formatter.converter = time.gmtime
845 | + class MicrosecondFormatter(logging.Formatter):
846 | + def formatTime(self, record, _=None):
by the way, I switched to _=None because datefmt=None runs into a linter error (unused variable 'datefmt' ), and omitting the arg is not allowed (TypeErrors). Not sure if the linter is correct to complain about this.
I can see it fail if python internally passes datefmt as a keyword arg. I can see disabling the linter, because it may be wrong due to this. I can also see just saying assert not datefmt to ensure it is None and ensure the keyword is used. But no strong opinion. I think anything is fine here.
I don't have a strong opinion either, I just wanted to mention this because _=None may look weird to some - if the current approach is fine I'll just leave it at this.