Skip to content

Commit f09bc71

Browse files
authored
Merge pull request #18 from edanalytics/hotfix/clean_logging
Replace single quotes in message with backticks.
2 parents ccdd3a1 + 228d64c commit f09bc71

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

lightbeam/send.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ async def do_post(self, endpoint, file_name, data, line, hash):
173173

174174
# warn about errors
175175
if response.status not in [ 200, 201 ]:
176-
message = str(response.status) + ": " + util.linearize(body)
176+
message = str(response.status) + ": " + util.linearize(json.loads(body).get("message"))
177177

178178
# update run metadata...
179179
failed_statuses_dict = self.metadata["resources"][endpoint].get("failed_statuses", {})

lightbeam/util.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@
22
import json
33

44
# Strips newlines from a string
5+
# Replace single-quotes with backticks
56
def linearize(string: str) -> str:
67
exp = re.compile(r"\s+")
7-
return exp.sub(" ", string).strip()
8+
return exp.sub(" ", string).replace("'", "`").strip()
89

910
def camel_case(s):
1011
s = re.sub(r"(_|-)+", " ", s).title().replace(" ", "")

0 commit comments

Comments
 (0)