Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add a .log method for logging stuff to nqpjs.log when the env var NQP…
…JS_LOG is set.
  • Loading branch information
pmurias committed Oct 14, 2014
1 parent 8f4269b commit fe08dda
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/vm/js/QAST/Compiler.nqp
Expand Up @@ -825,6 +825,16 @@ class QAST::OperationsJS {

class QAST::CompilerJS does DWIMYNameMangling does SerializeOnce {

#= If the env var NQPJS_LOG is set log to nqpjs.log
method log(*@msgs) {
my %env := nqp::getenvhash();
if %env<NQPJS_LOG> {
my $log := nqp::open('nqpjs.log', 'wa');
nqp::printfh($log, nqp::join(',', @msgs));
nqp::closefh($log);
}
}

# Holds information about the QAST::Block we're currently compiling.
# The currently compiled block is stored in $*BLOCK
my class BlockInfo {
Expand Down

0 comments on commit fe08dda

Please sign in to comment.