Module: NexusCli::LoggingActions
Overview
Instance Method Summary collapse
-
#get_logging_info ⇒ String
Gets information about the current logging levels in Nexus.
-
#set_logger_level(level) ⇒ Boolean
Sets the logging level of Nexus to one of “INFO”, “DEBUG”, or “ERROR”.
Instance Method Details
#get_logging_info ⇒ String
Gets information about the current logging levels in Nexus.
10 11 12 13 14 15 16 17 18 |
# File 'lib/nexus_cli/mixins/logging_actions.rb', line 10 def get_logging_info response = nexus.get(nexus_url("service/local/log/config"), :header => DEFAULT_ACCEPT_HEADER) case response.status when 200 return response.content else raise UnexpectedStatusCodeException.new(response.status) end end |
#set_logger_level(level) ⇒ Boolean
Sets the logging level of Nexus to one of “INFO”, “DEBUG”, or “ERROR”.
27 28 29 30 31 32 33 34 35 36 |
# File 'lib/nexus_cli/mixins/logging_actions.rb', line 27 def set_logger_level(level) raise InvalidLoggingLevelException unless ["INFO", "DEBUG", "ERROR"].include?(level.upcase) response = nexus.put(nexus_url("service/local/log/config"), :body => create_logger_level_json(level), :header => DEFAULT_CONTENT_TYPE_HEADER) case response.status when 200 return true else raise UnexpectedStatusCodeException.new(response.status) end end |