Skip to content

Commit

Permalink
Use Blacklight.logger for logging
Browse files Browse the repository at this point in the history
  • Loading branch information
tampakis committed Jan 4, 2017
1 parent 5bb0be6 commit d54dd90
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions app/controllers/concerns/blacklight/catalog.rb
Expand Up @@ -298,11 +298,11 @@ def handle_request_error(exception)
# If there are errors coming from the index page, we want to trap those sensibly

if flash[:notice] == flash_notice
logger.error "Cowardly aborting rsolr_request_error exception handling, because we redirected to a page that raises another exception"
Blacklight.logger.error "Cowardly aborting rsolr_request_error exception handling, because we redirected to a page that raises another exception"
raise exception
end

logger.error exception
Blacklight.logger.error exception

flash[:notice] = flash_notice
redirect_to search_action_url
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/concerns/blacklight/search_context.rb
Expand Up @@ -104,6 +104,6 @@ def setup_next_and_previous_documents
@next_document = documents.last
end
rescue Blacklight::Exceptions::InvalidRequest => e
logger.warn "Unable to setup next and previous documents: #{e}"
Blacklight.logger.warn "Unable to setup next and previous documents: #{e}"
end
end
4 changes: 2 additions & 2 deletions app/helpers/blacklight/render_partials_helper_behavior.rb
Expand Up @@ -175,7 +175,7 @@ def document_partial_path_templates
def find_document_show_template_with_view view_type, base_name, format, locals
document_partial_path_templates.each do |str|
partial = str % { action_name: base_name, format: format, index_view_type: view_type }
logger.debug "Looking for document partial #{partial}"
Blacklight.logger.debug "Looking for document partial #{partial}"
template = lookup_context.find_all(partial, lookup_context.prefixes + [""], true, locals.keys + [:document], {}).first
return template if template
end
Expand All @@ -185,7 +185,7 @@ def find_document_show_template_with_view view_type, base_name, format, locals
def find_document_index_template_with_view view, locals
document_index_path_templates.each do |str|
partial = str % { index_view_type: view }
logger.debug "Looking for document index partial #{partial}"
Blacklight.logger.debug "Looking for document index partial #{partial}"
template = lookup_context.find_all(partial, lookup_context.prefixes + [""], true, locals.keys + [:documents], {}).first
return template if template
end
Expand Down
2 changes: 1 addition & 1 deletion lib/blacklight/solr/response.rb
Expand Up @@ -91,7 +91,7 @@ def force_to_utf8(value)
value.each { |v| force_to_utf8(v) }
when String
if value.encoding != Encoding::UTF_8
Rails.logger.warn "Found a non utf-8 value in Blacklight::Solr::Response. \"#{value}\" Encoding is #{value.encoding}"
Blacklight.logger.warn "Found a non utf-8 value in Blacklight::Solr::Response. \"#{value}\" Encoding is #{value.encoding}"
value.dup.force_encoding('UTF-8')
else
value
Expand Down

0 comments on commit d54dd90

Please sign in to comment.