Sha256: 6c7e697f303f399869490a07ff55066eddf0834ad8168b050b0ca0d89d82ad2a
Contents?: true
Size: 726 Bytes
Versions: 4
Compression:
Stored size: 726 Bytes
Contents
require 'singleton' module JsDuck # Central logging of JsDuck class Logger include Singleton attr_accessor :verbose attr_accessor :warnings def initialize @verbose = false @warnings = true @shown_warnings = {} end # Prints log message def log(msg) puts msg if @verbose end # Prints warning message. # # Ignores duplicate warnings - only prints the first one. # Works best when --processes=0, but it reduces the amount of # warnings greatly also when run multiple processes. def warn(msg) if @warnings && !@shown_warnings[msg] $stderr.puts "Warning: " + msg @shown_warnings[msg] = true end end end end
Version data entries
4 entries across 4 versions & 1 rubygems
Version | Path |
---|---|
jsduck-3.0.pre2 | lib/jsduck/logger.rb |
jsduck-3.0.pre | lib/jsduck/logger.rb |
jsduck-2.0.pre4 | lib/jsduck/logger.rb |
jsduck-2.0.pre2 | lib/jsduck/logger.rb |