File: null_logger.rb

package info (click to toggle)
ruby-mixlib-authentication 3.0.6-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 256 kB
  • sloc: ruby: 1,099; makefile: 4
file content (24 lines) | stat: -rw-r--r-- 554 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
module Mixlib
  module Authentication
    module NullLogger

      attr_accessor :level

      %i{trace debug info warn error fatal}.each do |method_name|
        class_eval(<<-METHOD_DEFN, __FILE__, __LINE__)
          def #{method_name}(msg=nil, &block)
            true
          end
        METHOD_DEFN
      end

      %i{trace? debug? info? warn? error? fatal?}.each do |method_name|
        class_eval(<<-METHOD_DEFN, __FILE__, __LINE__)
          def #{method_name}
            false
          end
        METHOD_DEFN
      end
    end
  end
end