Skip to content

Commit

Permalink
Merge pull request #201 from noir-cr/improve/logging
Browse files Browse the repository at this point in the history
Improve logging
  • Loading branch information
hahwul authored Dec 16, 2023
2 parents 0d88661 + 070ac7d commit 82625c3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 16 deletions.
8 changes: 2 additions & 6 deletions src/models/output_builder.cr
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,7 @@ class OutputBuilder
end

def bake_endpoint(url : String, params : Array(Param))
if @is_debug
@logger.debug "Baking endpoint #{url} with #{params.size} params."
end
@logger.debug "Baking endpoint #{url} with #{params.size} params."

final_url = url
final_body = ""
Expand Down Expand Up @@ -92,9 +90,7 @@ class OutputBuilder
end
end

if @is_debug
@logger.debug "Baked endpoint #{final_url} with #{final_body} body and #{final_headers.size} headers."
end
@logger.debug "Baked endpoint #{final_url} with #{final_body} body and #{final_headers.size} headers."

{
url: final_url,
Expand Down
13 changes: 3 additions & 10 deletions src/noir.cr
Original file line number Diff line number Diff line change
Expand Up @@ -102,16 +102,9 @@ noir_options.each do |k, v|
end

app.logger.debug "Initialized Options:"
app.logger.debug_sub "Base: #{app.options[:base]}"
app.logger.debug_sub "Techs: #{app.options[:techs]}"
app.logger.debug_sub "Scope: #{app.options[:scope]}"
app.logger.debug_sub "Send Proxy: #{app.@send_proxy}"
app.logger.debug_sub "Send Req: #{app.@send_req}"
app.logger.debug_sub "Debug: #{app.@is_debug}"
app.logger.debug_sub "Color: #{app.@is_color}"
app.logger.debug_sub "Format: #{app.options[:format]}"
app.logger.debug_sub "Output: #{app.options[:output]}"
app.logger.debug_sub "Concurrency: #{app.options[:concurrency]}"
app.options.each do |k, v|
app.logger.debug_sub "#{k}: #{v}"
end

app.logger.system "Detecting technologies to base directory."
app.detect
Expand Down

0 comments on commit 82625c3

Please sign in to comment.