Sha256: 0c30f056ca2ea56db9c435a0f7a19088cec7ba524bfaac18b1811acd62394419

Contents?: true

Size: 1.2 KB

Versions: 32

Compression:

Stored size: 1.2 KB

Contents

module Cuboid
module UI
module OutputInterface

# @author Tasos "Zapotek" Laskos <tasos.laskos@gmail.com>
module Implemented

    # Prints the backtrace of an exception as error messages.
    #
    # @param    [Exception] e
    def print_error_backtrace( e )
        e.backtrace.each { |line| print_error( line ) }
    end

    def print_exception( e )
        print_error "[#{e.class}] #{e}"
        print_error_backtrace( e )
    end

    def print_debug_level_1( str = '' )
        print_debug( str, 1 )
    end

    def print_debug_level_2( str = '' )
        print_debug( str, 2 )
    end

    def print_debug_level_3( str = '' )
        print_debug( str, 3 )
    end

    def print_debug_level_4( str = '' )
        print_debug( str, 4 )
    end

    def print_debug_exception( e, level = 1 )
        return if !debug?

        print_debug( "[#{e.class}] #{e}", level )
        print_debug_backtrace( e, level )
    end

    # Prints the backtrace of an exception as debugging messages.
    #
    # @param    [Exception] e
    #
    # @see #debug?
    # @see #debug
    def print_debug_backtrace( e, level = 1 )
        return if !debug?
        e.backtrace.each { |line| print_debug( line, level ) }
    end

end

end
end
end

Version data entries

32 entries across 32 versions & 1 rubygems

Version Path
cuboid-0.1.5 lib/cuboid/ui/output_interface/implemented.rb
cuboid-0.1.4 lib/cuboid/ui/output_interface/implemented.rb
cuboid-0.1.3 lib/cuboid/ui/output_interface/implemented.rb
cuboid-0.1.2 lib/cuboid/ui/output_interface/implemented.rb
cuboid-0.1.1 lib/cuboid/ui/output_interface/implemented.rb
cuboid-0.1.0 lib/cuboid/ui/output_interface/implemented.rb
cuboid-0.0.5 lib/cuboid/ui/output_interface/implemented.rb
cuboid-0.0.4 lib/cuboid/ui/output_interface/implemented.rb
cuboid-0.0.3 lib/cuboid/ui/output_interface/implemented.rb
cuboid-0.0.3alpha lib/cuboid/ui/output_interface/implemented.rb
cuboid-0.0.2alpha lib/cuboid/ui/output_interface/implemented.rb
cuboid-0.0.1alpha lib/cuboid/ui/output_interface/implemented.rb