[prev in list] [next in list] [prev in thread] [next in thread] 

List:       gnuradio-discuss
Subject:    Python Log Level GR 3.10
From:       "Merlo, Jason" <merlojas () msu ! edu>
Date:       2022-12-20 14:34:05
Message-ID: 5B7B76DB-7664-4961-9951-72517BED6270 () msu ! edu
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


I've been having trouble migrating my OOT module to GR 3.10 (currently testing with \
3.10.5) due to the Python block logging levels not working as they did prior to 3.10. \
Currently, I have a parameter on most of my blocks to selectively set the log level \
per block instance to help filter what is printing, however, it doesn't seem this \
works anymore.

The way I have it implemented is in the __init__ function of my blocks I run:
    self.logger = gr.logger(self.alias())
    self.logger.set_level(log_level)

Then elsewhere in the class issue logging statements as usual: \
self.logger.debug(f'some debug message')

In GR 3.9, this would print "some debug message" if that block's log_level was set to \
debug. However, now in 3.10 it appears nothing is being printed to stdout at all, \
regardless of log level.

I'm aware there have been some changes in the logger in 3.10, but the OOT porting \
guide suggests the only that need to be made are with the C++ logger (and that the \
old logging API still works—for now).

Are there any changes that must be made to the Python logger too?

Thanks in advance!
Jason


[Attachment #5 (unknown)]

<html><head><meta http-equiv="content-type" content="text/html; \
charset=utf-8"></head><body style="overflow-wrap: break-word; -webkit-nbsp-mode: \
space; line-break: after-white-space;"><div>I've been having trouble migrating my OOT \
module to GR 3.10 (currently testing with 3.10.5) due to the Python block logging \
levels not working as they did prior to 3.10. &nbsp;Currently, I have a parameter on \
most of my blocks to selectively set the log level per block instance to help filter \
what is printing, however, it doesn't seem this works \
anymore.</div><div><br></div><div>The way I have it implemented is in the __init__ \
function of my blocks I run:</div><div><div style="font-family: Menlo, Monaco, \
&quot;Courier New&quot;, monospace; line-height: 21px; white-space: pre;"><div>    \
self.logger = gr.logger(self.alias())</div><div>    \
self.logger.set_level(log_level)</div></div></div><div><br></div><div>Then elsewhere \
in the class issue logging statements as usual:&nbsp;<span style="font-family: Menlo, \
Monaco, &quot;Courier New&quot;, monospace; white-space: pre;">self</span><span \
style="font-family: Menlo, Monaco, &quot;Courier New&quot;, monospace; white-space: \
pre;">.</span><span style="font-family: Menlo, Monaco, &quot;Courier New&quot;, \
monospace; white-space: pre;">logger</span><span style="font-family: Menlo, Monaco, \
&quot;Courier New&quot;, monospace; white-space: pre;">.debug(</span><span \
style="font-family: Menlo, Monaco, &quot;Courier New&quot;, monospace; white-space: \
pre;">f</span><font face="Menlo, Monaco, Courier New, monospace"><span \
style="caret-color: rgb(3, 47, 98); white-space: pre;">'</span></font><span \
style="font-family: Menlo, Monaco, &quot;Courier New&quot;, monospace; white-space: \
pre; caret-color: rgb(0, 92, 197);">some debug message</span><span \
style="font-family: Menlo, Monaco, &quot;Courier New&quot;, monospace; white-space: \
pre;">'</span><span style="font-family: Menlo, Monaco, &quot;Courier New&quot;, \
monospace; white-space: pre;">)</span></div><div><br></div><div>In GR 3.9, this would \
print "some debug message" if that block's log_level was set to debug. However, now \
in 3.10 it appears nothing is being printed to stdout at all, regardless of log \
level.</div><div><br></div><div>I'm aware there have been some changes in the logger \
in 3.10, but the OOT porting guide suggests the only that need to be made are with \
the C++ logger (and that the old logging API still works—for \
now).</div><div><br></div><div>Are there any changes that must be made to the Python \
logger too?</div><div><br></div>Thanks in advance!<br><div> <div dir="auto" \
style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); letter-spacing: normal; \
text-align: start; text-indent: 0px; text-transform: none; white-space: normal; \
word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; \
overflow-wrap: break-word; -webkit-nbsp-mode: space; line-break: \
after-white-space;"><div>Jason</div></div></div></body></html>


["signature.asc" (signature.asc)]

-----BEGIN PGP SIGNATURE-----

iQIzBAEBCAAdFiEEHTK0yw4swSYopzttnG6iWViO/Q8FAmOhx9MACgkQnG6iWViO
/Q8ODg/+LWympmlzQqGutN5u41ELQBO/AsUS5LTTnYfoiJwL70e2u3hCsBRzuOce
pgvd83iSFwONxAQ65Fu4MtHmkkneRGpJEXAede4nuvEZkc5NtOx654sBlhcwI9Km
qs3LeZJwNs9C6C46Q3bHuUSHn24oIbwCFa2E1oQrKGD8HpItuYpZTcswbV747FLv
UXQ9to1XUJ/0+kX4OZdT5AZPIgcfT/4RvECFpBfH41UOyqjHmK1gyn0UbT4KyT4Y
H16C8CjWnkDHAM2SEIaXEQEtkswHbaQMVfUjr90Be6Ap0wiEZ3rwxe3HU1/XPOyS
M/WIc58DgUfestMs50BTGO1O+0upQ8HCeoCkX3nPhqVofN46xiUJrTuKrUU/JacT
GjS+ARtUdisKA7V8ZmZOkOUVw8DTB+nyl+CoLaY4wCCycg/i/MY18qCtXjAVbxXH
Ufxv05pkZFeOKpavuS6p3HJw48oN5Qf8i9Qa46OfIoDGz3vF0W+b1OpeVfUQNeVK
raS7Y803M0ayREVe0ePVerkSRCea4O+7rCFl3kNNkR+LufNfzSU+bkl0BybRxA+N
7JZd21EUcq4xsPvH8a9HQmrW5CzB4esSAyqCaTXFMXQvE10EI/5c8YAHbXtUjL5y
ZIyWbvGC3ZNpg3FNqpr5OFPddO2YOxeCxYnuFhjtA+1w1IsTusM=
=1kCI
-----END PGP SIGNATURE-----


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic