WeeWX v4 logging

60 views
Skip to first unread message

Rich Bell

unread,
Apr 22, 2020, 1:24:01 PM4/22/20
to weewx-development
I've been experimenting/learning about the logging in v4. I am very excited and impressed! Reading https://github.com/weewx/weewx/wiki/WeeWX-v4-and-logging, the example of quieting a chatty module seems to be the opposite of what I, as an extension writer, would want. Meaning, most like likely I would like to turn my module logging to DEBUG while leaving other modules at INFO.
Adding the following to the [Logging][[loggers]] section seems to do what I want. Is there a better way? Is it worth adding to the wiki as another example?
        # Just want DEBUG for this module
       # Assuming WeeWX debug flag is 0, root logging level {log_level} is INFO
       # Along with setting the level, need to setup a handler for this module's logger
       # Do not want to propagate because INFO and higher would be doubled logged
       [[[user.MQTTSubscribe]]]
         level = DEBUG
         handlers = syslog,
         propagate = 0
Thanks. - Rich

Tom Keffer

unread,
Apr 22, 2020, 3:27:43 PM4/22/20
to Rich Bell, weewx-development
Absolutely! It's a good example of wanting to turn on debug messages for a specific module.

-tk


--
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 weewx-developm...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-development/8b94243d-08e2-4d3f-b751-8c564c44bff7%40googlegroups.com.

Rich Bell

unread,
Apr 23, 2020, 10:05:04 AM4/23/20
to weewx-development
Wiki has been updated. 
But, I am still toying with programmatically adding a file handler. This would have the advantages of the user only needing to configure the filename and the file would only have my module's messages. Of course it has the disadvantage of only capturing my module's messages...
Oh the possibilities. -rich

On Wednesday, 22 April 2020 15:27:43 UTC-4, Tom Keffer wrote:
Absolutely! It's a good example of wanting to turn on debug messages for a specific module.

-tk


On Wed, Apr 22, 2020 at 10:24 AM Rich Bell <bell...@gmail.com> wrote:
I've been experimenting/learning about the logging in v4. I am very excited and impressed! Reading https://github.com/weewx/weewx/wiki/WeeWX-v4-and-logging, the example of quieting a chatty module seems to be the opposite of what I, as an extension writer, would want. Meaning, most like likely I would like to turn my module logging to DEBUG while leaving other modules at INFO.
Adding the following to the [Logging][[loggers]] section seems to do what I want. Is there a better way? Is it worth adding to the wiki as another example?
        # Just want DEBUG for this module
       # Assuming WeeWX debug flag is 0, root logging level {log_level} is INFO
       # Along with setting the level, need to setup a handler for this module's logger
       # Do not want to propagate because INFO and higher would be doubled logged
       [[[user.MQTTSubscribe]]]
         level = DEBUG
         handlers = syslog,
         propagate = 0
Thanks. - Rich

--
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 weewx-de...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages