File tree Expand file tree Collapse file tree 3 files changed +7
-4
lines changed Expand file tree Collapse file tree 3 files changed +7
-4
lines changed Original file line number Diff line number Diff line change 1
1
import contextlib
2
2
import json
3
- import logging
4
3
from collections import defaultdict , deque
5
4
from collections .abc import Iterable
6
5
from typing import Any
13
12
from debug_toolbar import settings as dt_settings
14
13
from debug_toolbar .models import HistoryEntry
15
14
16
- logger = logging .getLogger (__name__ )
17
-
18
15
19
16
class DebugToolbarJSONEncoder (DjangoJSONEncoder ):
20
17
def default (self , o ):
21
18
try :
22
19
return super ().default (o )
23
20
except (TypeError , ValueError ):
24
- logger .debug ("The debug toolbar can't serialize %s into JSON" % o )
25
21
return force_str (o )
26
22
27
23
Original file line number Diff line number Diff line change 5
5
-------
6
6
7
7
* Added a note about the default password in ``make example ``.
8
+ * Removed logging about the toolbar failing to serialize a value into JSON.
8
9
9
10
6.0.0 (2025-07-22)
10
11
------------------
Original file line number Diff line number Diff line change @@ -14,6 +14,12 @@ def test_serialize(self):
14
14
'{"hello": {"foo": "bar"}}' ,
15
15
)
16
16
17
+ def test_serialize_logs_on_failure (self ):
18
+ self .assertEqual (
19
+ store .serialize ({"hello" : {"foo" : b"bar" }}),
20
+ '{"hello": {"foo": "bar"}}' ,
21
+ )
22
+
17
23
def test_deserialize (self ):
18
24
self .assertEqual (
19
25
store .deserialize ('{"hello": {"foo": "bar"}}' ),
You can’t perform that action at this time.
0 commit comments