Sha256: bffa87130c09785f04b684ae9fc3c83d114a713eaa40869acdb93bccae8e18b5

Contents?: true

Size: 847 Bytes

Versions: 3

Compression:

Stored size: 847 Bytes

Contents

module Bio

  module Log

    # NormalUser logs, but does not fail
    class NormalUser
      # include LoggerSubLevels

      def debug logger,msg
        logger.debug msg
      end
      def info logger,msg
        logger.info msg
      end
      def warn logger,msg
        logger.warn msg
      end
      def error logger,msg
        logger.error msg
      end
      def fatal logger,msg
        logger.fatal msg
      end
    end

    class FailOnErrorException < RuntimeError
    end

    class FailOnError < NormalUser
      def error logger, msg
        logger.error msg
        raise FailOnErrorException,msg
      end

      def fatal logger, msg
        logger.fatal msg
        raise FailOnErrorException
      end
    end

    # Developer acts so that errors raise an exception.
    class Developer < FailOnError
    end

  end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
bio-logger-1.0.1 lib/bio/log/loggerusers.rb
bio-logger-1.0.0 lib/bio/log/loggerusers.rb
bio-logger-0.9.0 lib/bio/log/loggerusers.rb