oasislabs/oasis-cli

nit: escape mapping is many-to-one

Closed this issue · 1 comments

.replace("\n", "\\n")

i noticed that this file is deleted in the PR that addresses the security review changes, so this is probably not relevant, just informative.

i'm not sure why we wanted/needed escape mapping, but the mapping is many-to-one and thus potentially confusing, i.e., "\n" and "\n" both map to "\n". since it's a logger the data being logged is probably not adversarial in nature and trying to maximize confusion, so this is just an ultra small nit. doing a .replace("\", "\\") before the "\n" and "\n" processing would make this one-to-one.

Clearly this is a hard problem:

what was written

Screen Shot 2019-08-01 at 11 07 41 AM

what was rendered

Screen Shot 2019-08-01 at 11 07 46 AM

I guess not every team has a Bennet! I'll keep this bug in mind in the future; thanks.

(also the escaping was because the log file is line oriented. we were logging some weird stuff (read: everything) back then)