Skip to content

Commit a635ac7

Browse files
authored
Merge pull request #57 from Worvast/master
Fixed Sender for logging (Handler) Severity correctly when custom Level
2 parents 7d60cdf + d2b6954 commit a635ac7

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
55
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
66

7+
## [2.2.2] - 2019-04-03
8+
#### Fixed
9+
* Sender for logging (Handler) get Severity correctly when use custom Level info
10+
711
## [2.2.1] - 2019-03-28
812
#### Fixed
913
* Lookup shell client now read config correctly

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
[![master Build Status](https://travis-ci.com/DevoInc/python-sdk.svg?branch=master)](https://travis-ci.com/DevoInc/python-sdk) [![LICENSE](https://img.shields.io/dub/l/vibe-d.svg)](https://github.com/DevoInc/python-sdk/blob/master/LICENSE)
33

4-
[![wheel](https://img.shields.io/badge/wheel-yes-brightgreen.svg)](https://pypi.org/project/devo-sdk/) [![version](https://img.shields.io/badge/version-2.2.1-blue.svg)](https://pypi.org/project/devo-sdk/) [![python](https://img.shields.io/badge/python-2.7%20%7C%203.3%20%7C%203.4%20%7C%203.5%20%7C%203.6%20%7C%203.7-blue.svg)](https://pypi.org/project/devo-sdk/)
4+
[![wheel](https://img.shields.io/badge/wheel-yes-brightgreen.svg)](https://pypi.org/project/devo-sdk/) [![version](https://img.shields.io/badge/version-2.2.2-blue.svg)](https://pypi.org/project/devo-sdk/) [![python](https://img.shields.io/badge/python-2.7%20%7C%203.3%20%7C%203.4%20%7C%203.5%20%7C%203.6%20%7C%203.7-blue.svg)](https://pypi.org/project/devo-sdk/)
55

66

77
# Devo Python SDK

devo/sender/data.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -506,7 +506,11 @@ def emit(self, record):
506506
try:
507507
msg = self.format(record)
508508
msg += '\000'
509-
self.send(tag=self._logger_tag, msg=msg, facility=self._logger_facility,
510-
severity=priority_map.get(record.levelname, "info"))
509+
try:
510+
severity = priority_map.get(record.levelname, record.levelno)
511+
except AttributeError:
512+
severity = priority_map.get("INFO")
513+
self.send(tag=self._logger_tag, msg=msg,
514+
facility=self._logger_facility, severity=severity)
511515
except Exception:
512516
self.handleError(record)

0 commit comments

Comments
 (0)