| 
					
					
						
							
						
					
					
				 | 
				@ -2,10 +2,11 @@ module Semantic | 
			
		
		
	
		
			
				 | 
				 | 
				  class LogSubscriber < ActiveSupport::LogSubscriber | 
				 | 
				 | 
				  class LogSubscriber < ActiveSupport::LogSubscriber | 
			
		
		
	
		
			
				 | 
				 | 
				    include SemanticLogger::Loggable | 
				 | 
				 | 
				    include SemanticLogger::Loggable | 
			
		
		
	
		
			
				 | 
				 | 
				    include AnsiColors | 
				 | 
				 | 
				    include AnsiColors | 
			
		
		
	
		
			
				 | 
				 | 
				    def logger = SemanticLogger['IRails'] | 
				 | 
				 | 
				 | 
			
		
		
	
		
			
				 | 
				 | 
				 | 
				 | 
				 | 
				    def logger = SemanticLogger['Rails'] | 
			
		
		
	
		
			
				 | 
				 | 
				
 | 
				 | 
				 | 
				
 | 
			
		
		
	
		
			
				 | 
				 | 
				    INTERNAL_PARAMS = %i[controller action format _method only_path].freeze | 
				 | 
				 | 
				    INTERNAL_PARAMS = %i[controller action format _method only_path].freeze | 
			
		
		
	
		
			
				 | 
				 | 
				    DEFAULT_DEV_HOSTS = ['127.0.0.1', 'localhost'].freeze | 
				 | 
				 | 
				    DEFAULT_DEV_HOSTS = ['127.0.0.1', 'localhost'].freeze | 
			
		
		
	
		
			
				 | 
				 | 
				 | 
				 | 
				 | 
				    TERMINUS_STRING = '╙─╜'.freeze | 
			
		
		
	
		
			
				 | 
				 | 
				
 | 
				 | 
				 | 
				
 | 
			
		
		
	
		
			
				 | 
				 | 
				    def initialize(session_key) | 
				 | 
				 | 
				    def initialize(session_key) | 
			
		
		
	
		
			
				 | 
				 | 
				      @session_key = session_key | 
				 | 
				 | 
				      @session_key = session_key | 
			
		
		
	
	
		
			
				| 
					
					
					
						
							
						
					
				 | 
				@ -20,7 +21,13 @@ module Semantic | 
			
		
		
	
		
			
				 | 
				 | 
				      SemanticLogger.tagged(session_value) do | 
				 | 
				 | 
				      SemanticLogger.tagged(session_value) do | 
			
		
		
	
		
			
				 | 
				 | 
				        request = event.payload[:request] | 
				 | 
				 | 
				        request = event.payload[:request] | 
			
		
		
	
		
			
				 | 
				 | 
				        path = colorize(request.filtered_path, BOLD) | 
				 | 
				 | 
				        path = colorize(request.filtered_path, BOLD) | 
			
		
		
	
		
			
				 | 
				 | 
				        logger.info("Started #{request.raw_request_method} #{path}") | 
				 | 
				 | 
				 | 
			
		
		
	
		
			
				 | 
				 | 
				 | 
				 | 
				 | 
				
 | 
			
		
		
	
		
			
				 | 
				 | 
				 | 
				 | 
				 | 
				        dimensions = Semantic::AnsiDimensions.new(rails: '╓─╖', before: 1) | 
			
		
		
	
		
			
				 | 
				 | 
				 | 
				 | 
				 | 
				        if defined?(@previously_redirect) && @previously_redirect | 
			
		
		
	
		
			
				 | 
				 | 
				 | 
				 | 
				 | 
				          dimensions = Semantic::AnsiDimensions.new(rails: '╓║╖', before: 0) | 
			
		
		
	
		
			
				 | 
				 | 
				 | 
				 | 
				 | 
				          @previously_redirect = false | 
			
		
		
	
		
			
				 | 
				 | 
				 | 
				 | 
				 | 
				        end | 
			
		
		
	
		
			
				 | 
				 | 
				 | 
				 | 
				 | 
				        logger.info("Started #{request.raw_request_method} #{path}", dimensions:) | 
			
		
		
	
		
			
				 | 
				 | 
				
 | 
				 | 
				 | 
				
 | 
			
		
		
	
		
			
				 | 
				 | 
				        format = event.payload[:format] | 
				 | 
				 | 
				        format = event.payload[:format] | 
			
		
		
	
		
			
				 | 
				 | 
				        format = format.to_s.upcase if format.is_a?(Symbol) | 
				 | 
				 | 
				        format = format.to_s.upcase if format.is_a?(Symbol) | 
			
		
		
	
	
		
			
				| 
					
						
							
						
					
					
						
							
						
					
					
				 | 
				@ -60,7 +67,21 @@ module Semantic | 
			
		
		
	
		
			
				 | 
				 | 
				          logger.debug process_duration(event, additions) | 
				 | 
				 | 
				          logger.debug process_duration(event, additions) | 
			
		
		
	
		
			
				 | 
				 | 
				        end | 
				 | 
				 | 
				        end | 
			
		
		
	
		
			
				 | 
				 | 
				
 | 
				 | 
				 | 
				
 | 
			
		
		
	
		
			
				 | 
				 | 
				        logger.info("Completed #{colorize(status, BOLD)} #{Rack::Utils::HTTP_STATUS_CODES[status]}") | 
				 | 
				 | 
				 | 
			
		
		
	
		
			
				 | 
				 | 
				 | 
				 | 
				 | 
				        status_family = status / 100 | 
			
		
		
	
		
			
				 | 
				 | 
				 | 
				 | 
				 | 
				
 | 
			
		
		
	
		
			
				 | 
				 | 
				 | 
				 | 
				 | 
				        dimensions = case status_family | 
			
		
		
	
		
			
				 | 
				 | 
				 | 
				 | 
				 | 
				                     when 2 | 
			
		
		
	
		
			
				 | 
				 | 
				 | 
				 | 
				 | 
				                       Semantic::AnsiDimensions.new(rails: TERMINUS_STRING, after: 1) | 
			
		
		
	
		
			
				 | 
				 | 
				 | 
				 | 
				 | 
				                     when 3 | 
			
		
		
	
		
			
				 | 
				 | 
				 | 
				 | 
				 | 
				                       Semantic::AnsiDimensions.new(rails: '╙║╜') | 
			
		
		
	
		
			
				 | 
				 | 
				 | 
				 | 
				 | 
				                     when 4 | 
			
		
		
	
		
			
				 | 
				 | 
				 | 
				 | 
				 | 
				                       Semantic::AnsiDimensions.new(rails: '╙╨╜') | 
			
		
		
	
		
			
				 | 
				 | 
				 | 
				 | 
				 | 
				                     when 5 | 
			
		
		
	
		
			
				 | 
				 | 
				 | 
				 | 
				 | 
				                       Semantic::AnsiDimensions.new(rails: '╙║╜') | 
			
		
		
	
		
			
				 | 
				 | 
				 | 
				 | 
				 | 
				                     end | 
			
		
		
	
		
			
				 | 
				 | 
				 | 
				 | 
				 | 
				        logger.info("Completed #{colorize(status, BOLD)} #{Rack::Utils::HTTP_STATUS_CODES[status]}", dimensions:) | 
			
		
		
	
		
			
				 | 
				 | 
				 | 
				 | 
				 | 
				        logger.info(' ', dimensions: Semantic::AnsiDimensions.new(rails: ' ║ ')) if status_family == 3 | 
			
		
		
	
		
			
				 | 
				 | 
				 | 
				 | 
				 | 
				        logger.info(' ', dimensions: Semantic::AnsiDimensions.new(rails: '╓║╖')) if status_family == 5 | 
			
		
		
	
		
			
				 | 
				 | 
				      end | 
				 | 
				 | 
				      end | 
			
		
		
	
		
			
				 | 
				 | 
				    end | 
				 | 
				 | 
				    end | 
			
		
		
	
		
			
				 | 
				 | 
				
 | 
				 | 
				 | 
				
 | 
			
		
		
	
	
		
			
				| 
					
					
					
						
							
						
					
				 | 
				@ -69,6 +90,7 @@ module Semantic | 
			
		
		
	
		
			
				 | 
				 | 
				        location = capture_path(event.payload[:location]) | 
				 | 
				 | 
				        location = capture_path(event.payload[:location]) | 
			
		
		
	
		
			
				 | 
				 | 
				        logger.debug("Redirected to #{colorize(location, BOLD)}") | 
				 | 
				 | 
				        logger.debug("Redirected to #{colorize(location, BOLD)}") | 
			
		
		
	
		
			
				 | 
				 | 
				      end | 
				 | 
				 | 
				      end | 
			
		
		
	
		
			
				 | 
				 | 
				 | 
				 | 
				 | 
				      @previously_redirect = true | 
			
		
		
	
		
			
				 | 
				 | 
				    end | 
				 | 
				 | 
				    end | 
			
		
		
	
		
			
				 | 
				 | 
				
 | 
				 | 
				 | 
				
 | 
			
		
		
	
		
			
				 | 
				 | 
				    def any_hook(event) | 
				 | 
				 | 
				    def any_hook(event) | 
			
		
		
	
	
		
			
				| 
					
						
							
						
					
					
					
				 | 
				
  |