Skip to content

Commit

Permalink
SNOW-856233 disable easy logging (#695)
Browse files Browse the repository at this point in the history
SNOW-856233 disable easy logging
  • Loading branch information
sfc-gh-knozderko authored Nov 9, 2023
1 parent a073e14 commit 2abf45c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 21 deletions.
24 changes: 4 additions & 20 deletions lib/connection/connection.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,8 @@ var Statement = require('./statement');
var Parameters = require('../parameters');
var Authenticator = require('../authentication/authentication');
var Logger = require('../logger');
const {init: initEasyLogging} = require('../logger/easy_logging_starter')
const {isOktaAuth} = require('../authentication/authentication');


const PRIVATELINK_URL_SUFFIX = ".privatelink.snowflakecomputing.com";

/**
Expand Down Expand Up @@ -273,19 +271,10 @@ function Connection(context)
throw authErr;
}

initEasyLogging(connectionConfig.clientConfigFile)
.then(() => {
try {
services.sf.connect({
callback: connectCallback(self, callback),
json: body
});
} catch (e) {
// we don't expect an error here since callback method should be called
Logger.getInstance().error('Unexpected error from calling callback function', e);
}
})
.catch(() => callback(Errors.createClientError(ErrorCodes.ERR_CONN_CONNECT_INVALID_CLIENT_CONFIG)));
services.sf.connect({
callback: connectCallback(self, callback),
json: body
});
return this;
};

Expand Down Expand Up @@ -319,11 +308,6 @@ function Connection(context)

try
{
try {
await initEasyLogging(connectionConfig.clientConfigFile);
} catch (err) {
throw Errors.createClientError(ErrorCodes.ERR_CONN_CONNECT_INVALID_CLIENT_CONFIG);
}
await auth.authenticate(connectionConfig.getAuthenticator(),
connectionConfig.getServiceName(),
connectionConfig.account,
Expand Down
4 changes: 4 additions & 0 deletions lib/logger/easy_logging_starter.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ const getClientConfig = clientConfiguration.getClientConfig;
let initTrialParameters;

/**
* This is an experimental feature. Not ready to use yet.
* @param {string} configFilePathFromConnectionString
* @returns {Promise<void>}
*/
Expand Down Expand Up @@ -47,6 +48,9 @@ exports.init = async function (configFilePathFromConnectionString) {
}
};

/**
* This is an experimental feature. Not ready to use yet.
*/
exports.reset = function () {
initTrialParameters = undefined;
Logger.getInstance().easyLoggingConfigureCounter = undefined;
Expand Down
2 changes: 1 addition & 1 deletion test/integration/testEasyLoggingOnConnecting.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const {codes} = require('./../../lib/errors');
const errorMessages = require('./../../lib/constants/error_messages');
let tempDir = null;

describe('Easy logging tests', function () {
describe.skip('Easy logging tests', function () {

before(async function () {
tempDir = await fsPromises.mkdtemp(path.join(os.tmpdir(), 'easy_logging_connect_tests_'));
Expand Down

0 comments on commit 2abf45c

Please sign in to comment.