module
Memo::BusLog
Overview
Console logging for memo-arcana: colored, timestamped lines on STDERR, with request parameters summarized and secrets redacted.
Extended Modules
Direct including types
Defined in:
arcana/bus_log.crConstant Summary
-
BOLD =
"\e[1m" -
CYAN =
"\e[36m" -
DIM =
"\e[2m" -
GRAY =
"\e[90m" -
GREEN =
"\e[32m" -
RED =
"\e[31m" -
RESET =
"\e[0m" -
SENSITIVE_KEYS =
Set {"api_key", "password", "secret", "token", "key"} -
YELLOW =
"\e[33m"
Class Method Summary
-
.output : IO
Where log lines go (specs silence it)
-
.output=(output : IO)
Where log lines go (specs silence it)
Instance Method Summary
- #log(msg : String)
-
#redact_db_url(text : String) : String
The text with *** for the passwords in any database URLs in it: the user's password (postgres://user:pass@host) and query parameters such as ?password= or &sslpassword=.
- #sensitive?(key : String) : Bool
- #summarize(data : JSON::Any) : String
- #truncate(s : String, max : Int32 = 50) : String
Class Method Detail
Instance Method Detail
def redact_db_url(text : String) : String
#
The text with *** for the passwords in any database URLs in it: the user's password (postgres://user:pass@host) and query parameters such as ?password= or &sslpassword=. Works on messages too.