Created
March 1, 2012 17:12
-
-
Save cadwallion/1951475 to your computer and use it in GitHub Desktop.
FuckLogger - when breakpoints aren't good enough
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class FuckLogger | |
class << self | |
attr_reader :count | |
attr_accessor :logger | |
def fuck | |
add | |
log "FUCK#{count}" | |
end | |
def add | |
@count ||= 0 | |
@count += 1 | |
end | |
def log message | |
@logger ||= LazyLog | |
@logger.debug message | |
end | |
end | |
class LazyLog | |
def self.debug message | |
$stdout.puts message | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment