module Debug

Overview

This is largely copied from https://github.com/Sija/debug.cr with a few patches applied (mostly because I can't just monkeypatch the value of a constant, ACTIVE). The patches will be contributed back to the main project, and accepted, this can disappear into the void.

Specifically, this version responds to both the compile time flag, DEBUG, and compile time as well as runtime flagging via the DEBUG environment variable.

This version also adds a macro level debugging statement, macro_debug!.

Defined in:

lib/debug/src/debug/core_ext/kernel.cr
lib/debug/src/debug/logger.cr
lib/debug/src/debug/settings.cr
lib/debug/src/debug/version.cr
ext/debug.cr

Constant Summary

ACTIVE = nil
MDEBUG_COLORS = {:severity => "82", :separator => "230", :file => "8", :lineno => "8", :message => "15"}

This constant contains the colors used when highlighting macro debugging statements via mdebug!. For more information on these codes, see this link: https://en.wikipedia.org/wiki/ANSI_escape_code#8-bit

Class Method Summary

Macro Summary

Class Method Detail

def self.enabled=(enabled : Bool | Nil) #

def self.enabled? : Bool #

Macro Detail

macro log(*args, severity = :debug, progname = nil, backtrace_offset = 0, file = __FILE__, line = __LINE__) #