Skip to content

Commit

Permalink
Add debug message in models 🔭
Browse files Browse the repository at this point in the history
  • Loading branch information
hahwul committed Sep 12, 2023
1 parent 0ec30cc commit d77d644
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/models/analyzer.cr
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ class Analyzer
base = locator.get("#{key}_basepath")
if base != ""
@base_path = base
if @is_debug
@logger.debug("Base path is set to #{base}")
end
end
end

Expand Down
3 changes: 3 additions & 0 deletions src/models/detector.cr
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ class Detector

if custom_base != ""
locator.set("#{@name}_basepath", custom_base)
if @is_debug
@logger.debug("Set #{@name}_basepath to #{custom_base}")
end
else
locator.set("#{@name}_basepath", @base_path)
end
Expand Down
8 changes: 8 additions & 0 deletions src/models/noir.cr
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,10 @@ class NoirRunner
end

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

final_url = url
final_body = ""
final_headers = [] of String
Expand Down Expand Up @@ -155,6 +159,10 @@ class NoirRunner
end
end

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

{
url: final_url,
body: final_body,
Expand Down

0 comments on commit d77d644

Please sign in to comment.