Skip to content

Commit 4c4277f

Browse files
committed
Rename null_formatter to raw_formatter in BaseTransport class
1 parent be7125f commit 4c4277f

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

beaver/config.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,9 @@ def _main_parser(config):
266266
if config[key] is not None:
267267
config[key] = float(config[key])
268268

269+
if config.get('format') == 'null':
270+
config['format'] = 'raw'
271+
269272
if config['files'] is not None and type(config['files']) == str:
270273
config['files'] = config['files'].split(',')
271274

@@ -332,6 +335,9 @@ def _section_parser(config, raise_exceptions=True):
332335
except TypeError:
333336
config['tags'] = []
334337

338+
if config.get('format') == 'null':
339+
config['format'] = 'raw'
340+
335341
file_type = config.get('type', None)
336342
if not file_type:
337343
config['type'] = 'file'

beaver/transports/base_transport.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ def __init__(self, beaver_config, logger=None):
3232
self._is_valid = True
3333
self._logger = logger
3434

35-
def null_formatter(data):
35+
def raw_formatter(data):
3636
return data['@message']
3737

3838
def rawjson_formatter(data):
@@ -53,7 +53,7 @@ def string_formatter(data):
5353

5454
self._formatters['json'] = json.dumps
5555
self._formatters['msgpack'] = msgpack.packb
56-
self._formatters['null'] = null_formatter
56+
self._formatters['raw'] = raw_formatter
5757
self._formatters['rawjson'] = rawjson_formatter
5858
self._formatters['string'] = string_formatter
5959

0 commit comments

Comments
 (0)