@@ -51,14 +51,14 @@ def format(self, record):
51
51
data = dict ([(key , value % record .__dict__ )
52
52
for key , value in self ._fmt_dict .items ()])
53
53
54
- self ._structuring (data , record . msg )
54
+ self ._structuring (data , record )
55
55
return data
56
56
57
57
def usesTime (self ):
58
58
return any ([value .find ('%(asctime)' ) >= 0
59
59
for value in self ._fmt_dict .values ()])
60
60
61
- def _structuring (self , data , msg ):
61
+ def _structuring (self , data , record ):
62
62
""" Melds `msg` into `data`.
63
63
64
64
:param data: dictionary to be sent to fluent server
@@ -67,12 +67,15 @@ def _structuring(self, data, msg):
67
67
:mod:`logging` framework, a JSON encoded string or a dictionary
68
68
that will be merged into dictionary generated in :meth:`format.
69
69
"""
70
+ msg = record .msg
71
+
70
72
if isinstance (msg , dict ):
71
73
self ._add_dic (data , msg )
72
74
elif isinstance (msg , basestring ):
73
75
try :
74
76
self ._add_dic (data , json .loads (str (msg )))
75
77
except ValueError :
78
+ msg = record .getMessage ()
76
79
self ._add_dic (data , {'message' : msg })
77
80
else :
78
81
self ._add_dic (data , {'message' : msg })
0 commit comments