Skip to content

Commit 49b0c50

Browse files
author
Suszyński Krzysztof
committed
Better logger+
1 parent 4eefd85 commit 49b0c50

File tree

1 file changed

+4
-1
lines changed
  • lib/puppet_forge_server/backends

1 file changed

+4
-1
lines changed

lib/puppet_forge_server/backends/proxy.rb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,9 @@ def get_file_buffer(relative_path)
4040
unless File.exist?("#{path}")
4141
buffer = download("#{@file_path.chomp('/')}/#{relative_path}")
4242
File.open(target_file, 'wb') do |file|
43-
file.write(buffer.read)
43+
bytes = buffer.read
44+
file.write(bytes)
45+
@log.debug("Saved #{bytes.size} bytes in filesystem cache for path: #{relative_path}, target file: #{target_file}")
4446
end
4547
path = target_file
4648
else
@@ -69,6 +71,7 @@ def get_non_mutable(relative_url)
6971
buffer = get(relative_url)
7072
File.open(target_file, 'wb') do |file|
7173
file.write(buffer)
74+
@log.debug("Saved #{buffer} bytes in filesystem cache for url: #{relative_url}, target file: #{target_file}")
7275
end
7376
path = target_file
7477
else

0 commit comments

Comments
 (0)