Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid unnecessary console.log calls #22

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions src/SybaseDB.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,16 @@ var fs = require("fs");
var PATH_TO_JAVA_BRIDGE1 = process.env.PWD + "/node_modules/sybase/JavaSybaseLink/dist/JavaSybaseLink.jar";
var PATH_TO_JAVA_BRIDGE2 = "./JavaSybaseLink/dist/JavaSybaseLink.jar";

function Sybase(host, port, dbname, username, password, logTiming, pathToJavaBridge)
function Sybase(host, port, dbname, username, password, logTiming, pathToJavaBridge, print_debug)
{
this.connected = false;
this.host = host;
this.port = port;
this.dbname = dbname;
this.username = username;
this.password = password;
this.logTiming = (logTiming == true);
this.logTiming = (logTiming == true);
this.print_debug = (print_debug === true)

this.pathToJavaBridge = pathToJavaBridge;
if (this.pathToJavaBridge === undefined)
Expand Down Expand Up @@ -92,12 +93,17 @@ Sybase.prototype.query = function(sql, callback)
msg.callback = callback;
msg.hrstart = hrstart;

console.log("this: " + this + " currentMessages: " + this.currentMessages + " this.queryCount: " + this.queryCount);
if(this.print_debug){
console.log("this: " + this + " currentMessages: " + this.currentMessages + " this.queryCount: " + this.queryCount);
}

this.currentMessages[msg.msgId] = msg;

this.javaDB.stdin.write(strMsg + "\n");
console.log("sql request written: " + strMsg);
this.javaDB.stdin.write(strMsg + "\n");

if(this.print_debug){
console.log("sql request written: " + strMsg);
}
};

Sybase.prototype.onSQLResponse = function(jsonMsg)
Expand Down