Thanks Tom,
The second option won't work for me, because I do want weewx debug messages
printed, but not those of the modbus data collecting section.
So, the following won't ,work for me:
Adding in weewx.conf:
======
[Logging]
[[loggers]]
[[[user.modbusenergy]]]
level = INFO
======
The first option worked like a charm!
=====
...
# Temporarily disable logging for events at or below DEBUG
logging.disable(logging.DEBUG)
# collect the modbus data
...
# Remove the temporary restriction
logging.disable(logging.NOTSET)
# let weewx handle the modbus data
...
=====
Luc
On Saturday, 14 March 2020 15:17:52 UTC-3, Vince Skahan wrote:
>
> Tom - I updated the driver I'm fiddling with per your wiki, and noticed
> that there's no backward compatibility example for the "In main programs"
> example at the top of the wiki page. Does this look right as a potential
> addition to the wiki ?
>
> Tests out ok on python3 / weewx4 FWIW....
>
> if __name__ == "__main__":
> usage = """%prog [options] [--help]"""
>
> def main():
> try:
> import logging
> import weeutil.logger
> log = logging.getLogger(__name__)
> weeutil.logger.setup('mydrivername', {} )
> except:
> import syslog
> syslog.openlog('mydrivername', syslog.LOG_PID |
> syslog.LOG_CONS)
>
>
>
>
>
--
You received this message because you are subscribed to the Google Groups
"weewx-development" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/weewx-development/4ed20fa9-d2fa-4637-8b0c-ca704460bc77%40googlegroups.com.