Dragon2fly/logger_tt

Bug in port selection

Opened this issue · 1 comments

There is now the option to select the port bind to in logger_tt, which especially useful if the default port (9020) is already bound to. However, if you choose port 0 in setup_logging(), which by default should let the OS choose a free port for you (wish is ideal), the conditional below:

self._port = odict.get('port') or handlers.DEFAULT_TCP_LOGGING_PORT

will result in the default port (9020) being selected again (0 or 9020 = 9020), and you are back to square one.

I have opened a PR to fix this.