module Wafalyzer::CLI

Defined in:

cli/log_formatter.cr
cli/settings.cr

Constant Summary

LogFormatter = ::Log::Formatter.new do |entry, io| colors = settings.colors severity = entry.severity io << ((severity.label.to_s.rjust(6)).colorize(settings.severity_colors[severity])) io << ' ' source = entry.source.presence if source ((io << '(') << (source.colorize(colors[:source]))) << ')' io << ' ' end timestamp = entry.timestamp ((io << '[') << (timestamp.to_s.colorize(colors[:datetime]))) << ']' message = entry.message (io << " -- ") << message data = entry.data if data.empty? else (io << " -- ") << (data.to_s.colorize(colors[:metadata])) end context = entry.context if context.empty? else (io << " -- ") << (context.to_s.colorize(colors[:metadata])) end ex = entry.exception if ex io.puts ex.inspect_with_backtrace(io) end end

Class Method Summary

Class Method Detail

def self.configure(&) : Nil #

Yields .settings to the given block.


[View source]
def self.settings #

[View source]