module Console::Terminal

Styled terminal output.

Styled terminal output.

Constants

CONSOLE_START_AT

This, and all related methods, is considered private.

Public Class Methods

for(io) click to toggle source
# File lib/console/terminal/logger.rb, line 49
def self.for(io)
        if io.isatty
                XTerm.new(io)
        else
                Text.new(io)
        end
end
start_at!(environment = ENV) click to toggle source

Exports CONSOLE_START which can be used to synchronize the start times of all child processes when they log using delta time.

# File lib/console/terminal/logger.rb, line 36
def self.start_at!(environment = ENV)
        if time_string = environment[CONSOLE_START_AT]
                start_at = Time.parse(time_string) rescue nil
        end
        
        unless start_at
                start_at = Time.now
                environment[CONSOLE_START_AT] = start_at.to_s
        end
        
        return start_at
end