Skip to content

Commit 7ccb07d

Browse files
Merge pull request #2588 from zyzniewski-reef/fix/2337-btlogging_setLevel
fix(2337): btlogging setLevel
2 parents 72dd8ad + 2a148ab commit 7ccb07d

File tree

5 files changed

+47
-2
lines changed

5 files changed

+47
-2
lines changed

CHANGELOG.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,24 @@
11
# Changelog
22

3+
## 8.5.2 /2025-01-17
4+
5+
## What's Changed
6+
* Feat/use tx pool for set weights by @camfairchild in https://github.com/opentensor/bittensor/pull/2534
7+
* fix get_delegates result decoding by @roman-opentensor in https://github.com/opentensor/bittensor/pull/2551
8+
* [SDK] Handle server connection limit by @roman-opentensor in https://github.com/opentensor/bittensor/pull/2553
9+
* Backmerge master to staging post 851 by @ibraheem-opentensor in https://github.com/opentensor/bittensor/pull/2557
10+
* [SDK] Improve InvalidStatus handler by @roman-opentensor in https://github.com/opentensor/bittensor/pull/2558
11+
* [SDK] Add async version of commit reveal v3 by @roman-opentensor in https://github.com/opentensor/bittensor/pull/2560
12+
* Use apt-get instead of apt for scripts by @camfairchild in https://github.com/opentensor/bittensor/pull/2571
13+
* fix _do_stake incorrect arguments error in staking.py by @Assh-codes in https://github.com/opentensor/bittensor/pull/2574
14+
* Updates tests for btwallet 3.0.0 by @ibraheem-opentensor in https://github.com/opentensor/bittensor/pull/2540
15+
* Bumps cr3 FFI by @ibraheem-opentensor in https://github.com/opentensor/bittensor/pull/2583
16+
17+
## New Contributors
18+
* @Assh-codes made their first contribution in https://github.com/opentensor/bittensor/pull/2574
19+
20+
**Full Changelog**: https://github.com/opentensor/bittensor/compare/v8.5.1...v8.5.2
21+
322
## 8.5.1 /2024-12-16
423

524
## What's Changed

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
8.5.1
1+
8.5.2

bittensor/core/settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
1616
# DEALINGS IN THE SOFTWARE.
1717

18-
__version__ = "8.5.1"
18+
__version__ = "8.5.2"
1919

2020
import os
2121
import re

bittensor/utils/btlogging/loggingmachine.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -582,6 +582,10 @@ def get_level(self) -> int:
582582
"""Returns Logging level."""
583583
return self._logger.level
584584

585+
def setLevel(self, level):
586+
"""Set the specified level on the underlying logger."""
587+
self._logger.setLevel(level)
588+
585589
def check_config(self, config: "Config"):
586590
assert config.logging
587591

tests/unit_tests/test_logging.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,3 +212,25 @@ def test_all_log_levels_output(logging_machine, caplog):
212212
def test_concat(msg, prefix, suffix, expected_result):
213213
"""Test different options of message concatenation with prefix and suffix."""
214214
assert _concat_message(msg, prefix, suffix) == expected_result
215+
216+
217+
def test_logger_level(logging_machine, caplog):
218+
"""Test get/set Logger level."""
219+
220+
assert logging_machine.get_level() == stdlogging.WARN
221+
222+
logging_machine.info("info1")
223+
logging_machine.warning("warn1")
224+
225+
assert "info1" not in caplog.text
226+
assert "warn1" in caplog.text
227+
228+
logging_machine.setLevel(stdlogging.INFO)
229+
230+
assert logging_machine.get_level() == stdlogging.INFO
231+
232+
logging_machine.info("info2")
233+
logging_machine.warning("warn2")
234+
235+
assert "info2" in caplog.text
236+
assert "warn2" in caplog.text

0 commit comments

Comments
 (0)