Skip to content

Commit 4a04cde

Browse files
authored
Merge pull request #9 from jdodds/logs-with-moustaches
fix edge case with {}'s in logs
2 parents 87a25d9 + 4fdedd1 commit 4a04cde

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/FsLibLog/FsLibLog.fs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -459,6 +459,10 @@ module Providers =
459459
let value = sprintf "%A" propertyValue
460460
msg <- msg.Replace(name, value)
461461

462+
// it's possible for msg at this point to have what looks like format
463+
// specifiers, which will cause String.Format to puke
464+
let msg = msg.Replace("{", "{{").Replace("}", "}}")
465+
462466
// then c# numeric replacements
463467
let msg = String.Format(CultureInfo.InvariantCulture, msg , formatParams)
464468

0 commit comments

Comments
 (0)