From 343ce211106066bbf695982c1fbb04df6fffc6d5 Mon Sep 17 00:00:00 2001 From: Eliot Horowitz Date: Sun, 8 Jun 2008 12:11:50 -0400 Subject: less debugging spam --- db/javajs.cpp | 23 ++++++++++++++++++----- db/query.cpp | 2 +- 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/db/javajs.cpp b/db/javajs.cpp index 86a0a9a2ac1..69c7d45bc62 100644 --- a/db/javajs.cpp +++ b/db/javajs.cpp @@ -14,6 +14,19 @@ using namespace boost::filesystem; + +//#define JNI_DEBUG 1 + +#ifdef JNI_DEBUG +#undef JNI_DEBUG +#define JNI_DEBUG(x) cerr << x << endl +#else +#undef JNI_DEBUG +#define JNI_DEBUG(x) +#endif + + + #ifdef J_USE_OBJ #include "jsobj.h" #pragma message("warning: including jsobj.h") @@ -416,7 +429,7 @@ const char * findEd(){ // --- JNIEXPORT void JNICALL java_native_say(JNIEnv * env , jclass, jobject outBuffer ){ - cerr << "native say called!" << endl; + JNI_DEBUG( "native say called!" ); Message out( env->GetDirectBufferAddress( outBuffer ) , false ); Message in; @@ -425,16 +438,16 @@ JNIEXPORT void JNICALL java_native_say(JNIEnv * env , jclass, jobject outBuffer } JNIEXPORT jint JNICALL java_native_call(JNIEnv * env , jclass, jobject outBuffer , jobject inBuffer ){ - cerr << "native call called!" << endl; + JNI_DEBUG( "native call called!" ); Message out( env->GetDirectBufferAddress( outBuffer ) , false ); Message in; jniCallback( out , in ); - cerr << "in.data : " << in.data << endl; + JNI_DEBUG( "in.data : " << in.data ); if ( in.data && in.data->len > 0 ){ - cerr << "copying data of len :" << in.data->len << endl; + JNI_DEBUG( "copying data of len :" << in.data->len ); memcpy( env->GetDirectBufferAddress( inBuffer ) , in.data , in.data->len ); return in.data->len; } @@ -445,7 +458,7 @@ JNIEXPORT jint JNICALL java_native_call(JNIEnv * env , jclass, jobject outBuffer // ---- int javajstest() { - + const int debug = 0; JavaJSImpl& JavaJS = *::JavaJS; diff --git a/db/query.cpp b/db/query.cpp index bd19ea653dd..2a624977630 100644 --- a/db/query.cpp +++ b/db/query.cpp @@ -407,7 +407,7 @@ string validateNS(const char *ns, NamespaceDetails *d) { bool userCreateNS(const char *ns, JSObj& j); -const int edebug=1; +const int edebug=0; bool dbEval(JSObj& cmd, JSObjBuilder& result) { Element e = cmd.firstElement(); -- cgit v1.2.1