Module: GoogleCloudRun::Severity
- Includes:
- Logger::Severity
- Defined in:
- lib/google_cloud_run/severity.rb
Constant Summary
Constants included from Logger::Severity
Logger::Severity::G_ALERT, Logger::Severity::G_CRITICAL, Logger::Severity::G_DEBUG, Logger::Severity::G_DEFAULT, Logger::Severity::G_EMERGENCY, Logger::Severity::G_ERROR, Logger::Severity::G_INFO, Logger::Severity::G_NOTICE, Logger::Severity::G_WARNING
Class Method Summary collapse
Class Method Details
.mapping(severity) ⇒ Object
65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 |
# File 'lib/google_cloud_run/severity.rb', line 65 def self.mapping(severity) case severity when nil; return G_DEFAULT when G_DEFAULT, G_DEBUG, G_INFO, G_NOTICE, G_WARNING, G_ERROR, G_CRITICAL, G_ALERT, G_EMERGENCY; return severity when DEBUG; return G_DEBUG when INFO; return G_INFO when WARN; return G_WARNING when ERROR; return G_ERROR when FATAL; return G_CRITICAL when UNKNOWN; return G_DEFAULT when 0; return G_DEFAULT when 1; return G_INFO when 2; return G_WARNING when 3; return G_ERROR when 4; return G_CRITICAL when 5; return G_DEFAULT when 100; return G_DEBUG when 200; return G_INFO when 300; return G_NOTICE when 400; return G_WARNING when 500; return G_ERROR when 600; return G_CRITICAL when 700; return G_ALERT when 800; return G_EMERGENCY when "G_DEFAULT"; return G_DEFAULT when "G_DEBUG"; return G_DEBUG when "G_INFO"; return G_INFO when "G_NOTICE"; return G_NOTICE when "G_WARNING"; return G_WARNING when "G_ERROR"; return G_ERROR when "G_CRITICAL"; return G_CRITICAL when "G_ALERT"; return G_ALERT when "G_EMERGENCY"; return G_EMERGENCY when :g_default; return G_DEFAULT when :g_debug; return G_DEBUG when :g_info; return G_INFO when :g_notice; return G_NOTICE when :g_warning; return G_WARNING when :g_error; return G_ERROR when :g_critical; return G_CRITICAL when :g_alert; return G_ALERT when :g_emergency; return G_EMERGENCY when :debug; return G_DEBUG when :info; return G_INFO when :warn; return G_WARNING when :error; return G_ERROR when :fatal; return G_CRITICAL when :unknown; return G_DEFAULT when :default; return G_DEFAULT when :notice; return G_NOTICE when :warning; return G_WARNING when :critical; return G_CRITICAL when :alert; return G_ALERT when :emergency; return G_EMERGENCY else raise "unknown severity '#{severity.inspect}'" end end |
.to_s(severity) ⇒ Object
51 52 53 54 55 56 57 58 59 60 61 62 63 |
# File 'lib/google_cloud_run/severity.rb', line 51 def self.to_s(severity) case mapping(severity) when G_DEFAULT; return "DEFAULT" when G_DEBUG; return "DEBUG" when G_INFO; return "INFO" when G_NOTICE; return "NOTICE" when G_WARNING; return "WARNING" when G_ERROR; return "ERROR" when G_CRITICAL; return "CRITICAL" when G_ALERT; return "ALERT" when G_EMERGENCY; return "EMERGENCY" end end |