From: Andy Spencer Date: Thu, 28 Jan 2016 05:51:59 +0000 (+0000) Subject: Remove special characters from the logs X-Git-Url: http://pileus.org/git/?p=~andy%2Frhawk;a=commitdiff_plain;h=934287791f5fe72ce414a2740c47de5647586707 Remove special characters from the logs --- diff --git a/spades.awk b/spades.awk index 46278eb..9f404d8 100644 --- a/spades.awk +++ b/spades.awk @@ -164,7 +164,7 @@ function sp_say(msg) { say(sp_channel, msg) print msg |& sp_sock - print strftime("%Y-%m-%d %H:%M:%S | ") msg >> "logs/" sp_log + print strftime("%Y-%m-%d %H:%M:%S | ") sp_ugly(msg) >> "logs/" sp_log fflush("logs/" sp_log) } @@ -183,6 +183,16 @@ function sp_pretty(cards, who) return cards } +function sp_ugly(cards, who) +{ + gsub(/[\2\17]|\3[14],00|/, "", cards) + gsub(/♠/, "s", cards) + gsub(/♥/, "h", cards) + gsub(/♦/, "d", cards) + gsub(/♣/, "c", cards) + return cards +} + function sp_next(who, prev) { prev = sp_turn