Skip to content

Commit

Permalink
default logger configuration after easy logging tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-knozderko committed Oct 31, 2023
1 parent da900d5 commit 91fbcac
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
6 changes: 2 additions & 4 deletions test/integration/testEasyLoggingOnConnecting.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ const assert = require('assert');
const logLevelBefore = Logger.getInstance().getLevel();
const {codes} = require('./../../lib/errors');
const errorMessages = require('./../../lib/constants/error_messages');
const {configureLogger} = require("../configureLogger")
let tempDir = null;

describe('Easy logging tests', function () {
Expand All @@ -21,10 +22,7 @@ describe('Easy logging tests', function () {
});

after(async function () {
Logger.getInstance().configure({
level: logLevelBefore,
filePath: 'snowflake.log'
});
configureLogger()
await fsPromises.rm(tempDir, { recursive: true, force: true });
});

Expand Down
7 changes: 2 additions & 5 deletions test/unit/logger/easy_logging_starter_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,17 @@ const fsPromises = require('fs/promises');
const path = require('path');
const os = require('os');
const Logger = require('../../../lib/logger');
const {configureLogger} = require("../../configureLogger")
require('../../../lib/snowflake'); // import of it sets up node logger
const defaultConfigName = 'sf_client_config.json';
const logLevelBefore = Logger.getInstance().getLevel();
let tempDir = null;

before(async function () {
tempDir = await fsPromises.mkdtemp(path.join(os.tmpdir(), 'easy_logging_starter_tests_'));
});

after(async function () {
Logger.getInstance().configure({
level: logLevelBefore,
filePath: 'snowflake.log'
});
configureLogger();
await fsPromises.rm(tempDir, { recursive: true, force: true });
});

Expand Down

0 comments on commit 91fbcac

Please sign in to comment.