Permalink
Browse files

[merb-core] Log more classloader behavior in verbose mode

During application boot, the classloader stashes
files with missing requirements to reload them
once all files have been processed. This needs to
be done when a not yet loaded constant is referenced
from the class being loaded. This patch prints a
message to the verbose log, telling which files
had missing requirements, and where the original
NameError happened.
  • Loading branch information...
1 parent 3f58b96 commit 604e0fdf4467cacde2d11c8ced491cac56ddc5f1 @snusnu snusnu committed Oct 29, 2009
Showing with 2 additions and 0 deletions.
  1. +2 −0 merb-core/lib/merb-core/bootloader.rb
@@ -949,6 +949,8 @@ def load_classes(*paths)
begin
load_file file
rescue NameError => ne
+ Merb.logger.verbose! "Stashed file with missing requirements for later reloading: #{file}"
+ ne.backtrace.each_with_index { |line, idx| Merb.logger.verbose! "[#{idx}]: #{line}" }
orphaned_classes.unshift(file)
end
end

0 comments on commit 604e0fd

Please sign in to comment.