From 4e4a4959a8f2388af94b222128e09da68129111d Mon Sep 17 00:00:00 2001 From: Eliot Horowitz Date: Sun, 25 Jul 2010 11:51:34 -0400 Subject: some log cleaning --- scripting/engine.cpp | 4 ++-- scripting/engine_spidermonkey.cpp | 8 +++++--- 2 files changed, 7 insertions(+), 5 deletions(-) (limited to 'scripting') diff --git a/scripting/engine.cpp b/scripting/engine.cpp index 305f3fe2592..7b47a0fb2d1 100644 --- a/scripting/engine.cpp +++ b/scripting/engine.cpp @@ -96,7 +96,7 @@ namespace mongo { path p( filename ); if ( ! exists( p ) ){ - cout << "file [" << filename << "] doesn't exist" << endl; + log() << "file [" << filename << "] doesn't exist" << endl; if ( assertOnError ) assert( 0 ); return false; @@ -116,7 +116,7 @@ namespace mongo { } if (empty){ - cout << "directory [" << filename << "] doesn't have any *.js files" << endl; + log() << "directory [" << filename << "] doesn't have any *.js files" << endl; if ( assertOnError ) assert( 0 ); return false; diff --git a/scripting/engine_spidermonkey.cpp b/scripting/engine_spidermonkey.cpp index effe006c957..fc60f13affb 100644 --- a/scripting/engine_spidermonkey.cpp +++ b/scripting/engine_spidermonkey.cpp @@ -887,13 +887,15 @@ namespace mongo { // --- global helpers --- JSBool native_print( JSContext * cx , JSObject * obj , uintN argc, jsval *argv, jsval *rval ){ + stringstream ss; Convertor c( cx ); for ( uintN i=0; i 0 ) - cout << " "; - cout << c.toString( argv[i] ); + ss << " "; + ss << c.toString( argv[i] ); } - cout << endl; + ss << "\n"; + Logstream::logLockless( ss.str() ); return JS_TRUE; } -- cgit v1.2.1