module Memo::BusLog

Overview

Console logging for memo-arcana: colored, timestamped lines on STDERR, with request parameters summarized and secrets redacted.

Direct including types

Defined in:

arcana/bus_log.cr

Constant 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

Instance Method Summary

Class Method Detail

def self.output : IO #

Where log lines go (specs silence it)


[View source]
def self.output=(output : IO) #

Where log lines go (specs silence it)


[View source]

Instance Method Detail

def log(msg : String) #

[View source]
def redact_db_url(url : String) : String #

[View source]
def sensitive?(key : String) : Bool #

[View source]
def summarize(data : JSON::Any) : String #

[View source]
def truncate(s : String, max : Int32 = 50) : String #

[View source]