Loading lib/jsduck/logger.rb +7 −1 Original line number Diff line number Diff line Loading @@ -10,8 +10,14 @@ module JsDuck # Set to true to enable verbose logging attr_accessor :verbose # Set true to force colored output. # Set false to force no colors. attr_accessor :colors def initialize @verbose = false @colors = nil @warning_docs = [ [:global, "Member doesn't belong to any class"], [:inheritdoc, "@inheritdoc referring to unknown class or member"], Loading Loading @@ -154,7 +160,7 @@ module JsDuck # Only does color output when STDERR is attached to TTY # i.e. is not piped/redirected. def paint(color_name, msg) if Util::OS.windows? || !$stderr.tty? if @colors == false || @colors == nil && (Util::OS.windows? || !$stderr.tty?) msg else COLORS[color_name] + msg + CLEAR Loading lib/jsduck/options.rb +9 −0 Original line number Diff line number Diff line Loading @@ -609,6 +609,15 @@ module JsDuck end end opts.on('--[no-]color', "Turn on/off colorized terminal output.", "", "By default the colored output is on, but gets disabled", "automatically when output is not an interactive terminal", "(or when running on Windows system).") do |on| Logger.colors = on end opts.on('-p', '--processes=COUNT', "The number of parallel processes to use.", "", Loading Loading
lib/jsduck/logger.rb +7 −1 Original line number Diff line number Diff line Loading @@ -10,8 +10,14 @@ module JsDuck # Set to true to enable verbose logging attr_accessor :verbose # Set true to force colored output. # Set false to force no colors. attr_accessor :colors def initialize @verbose = false @colors = nil @warning_docs = [ [:global, "Member doesn't belong to any class"], [:inheritdoc, "@inheritdoc referring to unknown class or member"], Loading Loading @@ -154,7 +160,7 @@ module JsDuck # Only does color output when STDERR is attached to TTY # i.e. is not piped/redirected. def paint(color_name, msg) if Util::OS.windows? || !$stderr.tty? if @colors == false || @colors == nil && (Util::OS.windows? || !$stderr.tty?) msg else COLORS[color_name] + msg + CLEAR Loading
lib/jsduck/options.rb +9 −0 Original line number Diff line number Diff line Loading @@ -609,6 +609,15 @@ module JsDuck end end opts.on('--[no-]color', "Turn on/off colorized terminal output.", "", "By default the colored output is on, but gets disabled", "automatically when output is not an interactive terminal", "(or when running on Windows system).") do |on| Logger.colors = on end opts.on('-p', '--processes=COUNT', "The number of parallel processes to use.", "", Loading