Skip to content
This repository has been archived by the owner on Jan 9, 2023. It is now read-only.

Commit

Permalink
Remove last usages of LOG_TEST level, and reduce value of LOG_DBG to 4.
Browse files Browse the repository at this point in the history
  • Loading branch information
stephen-palmer committed May 13, 2019
1 parent 65252bc commit 7ac57a6
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 8 deletions.
2 changes: 1 addition & 1 deletion lib/cache/cache_fs.js
Expand Up @@ -107,7 +107,7 @@ class CacheFS extends CacheBase {

const promises = transaction.files.map((file) =>
self._writeFileToCache(file.type, transaction.guid, transaction.hash, file.file)
.then(filePath => helpers.log(consts.LOG_TEST, `Added file to cache: ${file.size} ${filePath}`)));
.then(filePath => helpers.log(consts.LOG_DBG, `Added file to cache: ${file.size} ${filePath}`)));

return Promise.all(promises);
}
Expand Down
2 changes: 1 addition & 1 deletion lib/cache/cache_ram.js
Expand Up @@ -173,7 +173,7 @@ class CacheRAM extends CacheBase {

const entry = this._reserveBlock(key, buffer.length);

helpers.log(consts.LOG_TEST, `Saving file key: ${key} pageIndex: ${entry.pageIndex} pageOffset: ${entry.pageOffset} size: ${entry.size}`);
helpers.log(consts.LOG_DBG, `Saving file key: ${key} pageIndex: ${entry.pageIndex} pageOffset: ${entry.pageOffset} size: ${entry.size}`);

buffer.copy(this._pages[entry.pageIndex], entry.pageOffset, 0, buffer.length);

Expand Down
3 changes: 1 addition & 2 deletions lib/constants.js
Expand Up @@ -10,8 +10,7 @@ const constants = {
LOG_ERR: 1,
LOG_WARN: 2,
LOG_INFO: 3,
LOG_TEST: 4,
LOG_DBG: 5,
LOG_DBG: 4,
DEFAULT_PORT: 8126,
DEFAULT_HOST: "0.0.0.0",
DEFAULT_WORKERS: 0,
Expand Down
8 changes: 4 additions & 4 deletions test/helpers.js
Expand Up @@ -124,13 +124,13 @@ describe("Helper functions", () => {
it("should log a console message if the desired log level is >= the minimum level", () => {
const spy = sinon.spy(console, 'log');
const str = "Hello World";
helpers.setLogLevel(consts.LOG_TEST);
helpers.setLogLevel(consts.LOG_INFO);

helpers.defaultLogger(consts.LOG_WARN, str);
assert(spy.calledOnce);
spy.resetHistory();

helpers.defaultLogger(consts.LOG_TEST, str);
helpers.defaultLogger(consts.LOG_INFO, str);
assert(spy.calledOnce);
spy.resetHistory();

Expand All @@ -144,13 +144,13 @@ describe("Helper functions", () => {
it("should log a console message if the desired log level is >= the minimum level", () => {
const spy = sinon.spy(console, 'log');
const str = "Hello World";
helpers.setLogLevel(consts.LOG_TEST);
helpers.setLogLevel(consts.LOG_INFO);

helpers.defaultClusterLogger(consts.LOG_WARN, str);
assert(spy.calledOnce);
spy.resetHistory();

helpers.defaultClusterLogger(consts.LOG_TEST, str);
helpers.defaultClusterLogger(consts.LOG_INFO, str);
assert(spy.calledOnce);
spy.resetHistory();

Expand Down

0 comments on commit 7ac57a6

Please sign in to comment.