Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Make RAKUDO_MODULE_DEBUG output more consistent
  • Loading branch information
lizmat committed Apr 24, 2015
1 parent f74477c commit 5943fea
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/Perl6/ModuleLoader.nqp
Expand Up @@ -43,10 +43,10 @@ class Perl6::ModuleLoader does Perl6::ModuleLoaderVMConfig {
my &DYNAMIC :=
nqp::ctxlexpad(%settings_loaded{'CORE'})<&DYNAMIC>;
if nqp::isnull(&DYNAMIC) {
nqp::say('Could not initialize @*INC') if $DEBUG;
DEBUG('Could not initialize @*INC') if $DEBUG;
}
else {
nqp::say('Initializing @*INC') if $DEBUG;
DEBUG('Initializing @*INC') if $DEBUG;
&DYNAMIC('@*INC');
}
}
Expand All @@ -61,7 +61,7 @@ class Perl6::ModuleLoader does Perl6::ModuleLoaderVMConfig {

# Too early to have @*INC; probably no setting yet loaded to provide
# the PROCESS initialization.
nqp::say('Setting up default paths: . blib') if $DEBUG;
DEBUG('Setting up default paths: . blib') if $DEBUG;
my @search_paths;
@search_paths.push('.');
@search_paths.push('blib');
Expand Down Expand Up @@ -129,9 +129,11 @@ class Perl6::ModuleLoader does Perl6::ModuleLoaderVMConfig {
%chosen := %chosen.FLATTENABLE_HASH();
}
if $DEBUG {
my $text := "chosen:";
for %chosen {
say($_.key ~ ' => ' ~ $_.value);
$text := $text ~ "\n " ~ $_.key ~ ' => ' ~ $_.value;
}
DEBUG($text);
}
# If we didn't already do so, load the module and capture
# its mainline. Otherwise, we already loaded it so go on
Expand Down Expand Up @@ -274,7 +276,7 @@ class Perl6::ModuleLoader does Perl6::ModuleLoaderVMConfig {
if $setting_name ne 'NULL' {
# Unless we already did so, locate and load the setting.
unless nqp::defined(%settings_loaded{$setting_name}) {
nqp::say("Loading settings $setting_name") if $DEBUG;
DEBUG("Loading settings $setting_name") if $DEBUG;
# Find it.
my $path := self.find_setting($setting_name);

Expand All @@ -290,7 +292,7 @@ class Perl6::ModuleLoader does Perl6::ModuleLoaderVMConfig {
nqp::die("Unable to load setting $setting_name; maybe it is missing a YOU_ARE_HERE?");
}
%settings_loaded{$setting_name} := $*MAIN_CTX;
nqp::say("Settings $setting_name loaded") if $DEBUG;
DEBUG("Settings $setting_name loaded") if $DEBUG;
}

$setting := %settings_loaded{$setting_name};
Expand Down

0 comments on commit 5943fea

Please sign in to comment.