Sha256: a295f305c4ed048dbd95be266945e348524cdf1af96a358c860f85842e9952ae

Contents?: true

Size: 843 Bytes

Versions: 2

Compression:

Stored size: 843 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
      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

2 entries across 2 versions & 1 rubygems

Version Path
bio-logger-0.6.1 lib/bio/log/loggerusers.rb
bio-logger-0.6.0 lib/bio/log/loggerusers.rb