Skip to content

Commit

Permalink
chore: use better typings of consola once they are fixed #63
Browse files Browse the repository at this point in the history
  • Loading branch information
regevbr committed May 8, 2020
1 parent 9777ab8 commit 2a0fc3b
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -97,7 +97,7 @@
"@typescript-eslint/eslint-plugin": "^2.31.0",
"@typescript-eslint/parser": "^2.31.0",
"all-contributors-cli": "^6.14.2",
"cspell": "^4.0.60",
"cspell": "^4.0.61",
"eslint": "^6.8.0",
"eslint-config-prettier": "^6.11.0",
"eslint-plugin-jest": "^23.9.0",
Expand Down
2 changes: 1 addition & 1 deletion src/utils/logger/impl/logLevel.ts
Expand Up @@ -8,7 +8,7 @@ const logLevelMap = {
[LogLevel.INFO]: ConsolaLogLevel.Info,
[LogLevel.DEBUG]: ConsolaLogLevel.Debug,
[LogLevel.TRACE]: ConsolaLogLevel.Trace,
[LogLevel.SILENT]: ConsolaLogLevel.Silent,
[LogLevel.SILENT]: -ConsolaLogLevel.Silent, // Hack until the issue of fixed
};

export const getConoslaLogLevel = (level: LogLevel): ConsolaLogLevel => logLevelMap[level];
2 changes: 1 addition & 1 deletion src/utils/logger/impl/logger.ts
Expand Up @@ -32,7 +32,7 @@ export class Logger extends Consola implements ILogger {
}

public isSilent(): boolean {
return this.isLevelEnabled(LogLevel.SILENT);
return this.level === getConoslaLogLevel(LogLevel.SILENT);
}

private isLevelEnabled(level: LogLevel): boolean {
Expand Down
2 changes: 1 addition & 1 deletion test/src/utils/logger/impl/logLevel.spec.ts
Expand Up @@ -11,7 +11,7 @@ describe(`log level`, () => {
expect(getConoslaLogLevel(LogLevel.INFO)).toEqual(ConsolaLogLevel.Info);
expect(getConoslaLogLevel(LogLevel.DEBUG)).toEqual(ConsolaLogLevel.Debug);
expect(getConoslaLogLevel(LogLevel.TRACE)).toEqual(ConsolaLogLevel.Trace);
expect(getConoslaLogLevel(LogLevel.SILENT)).toEqual(ConsolaLogLevel.Silent);
expect(getConoslaLogLevel(LogLevel.SILENT)).toEqual(-ConsolaLogLevel.Silent);
});
});
});
24 changes: 12 additions & 12 deletions yarn.lock
Expand Up @@ -2223,10 +2223,10 @@ cspell-io@^4.0.21:
iconv-lite "^0.4.24"
iterable-to-stream "^1.0.1"

cspell-lib@^4.1.26:
version "4.1.26"
resolved "https://registry.yarnpkg.com/cspell-lib/-/cspell-lib-4.1.26.tgz#e40435f96d570597485484a467997436229f5e22"
integrity sha512-Mu5oovFz3QQAZcBkDEZh2aLIZMEtd5Pu3JAjF9seMeIltcj36atR3E7PE1ilbTrpIgY/LjxezLk5ZlrQf04c1w==
cspell-lib@^4.1.27:
version "4.1.27"
resolved "https://registry.yarnpkg.com/cspell-lib/-/cspell-lib-4.1.27.tgz#dc49e3d77da350d457ec693b606840fb8b55286e"
integrity sha512-elczs/1V4rL9R4/Sfb5Xg2wkzpd/qDvelk70SChY+6pMzFhqu7nQbs5bmrhHB+Z1ELnmvrUtJBmkeo1uYvN0AQ==
dependencies:
comment-json "^1.1.3"
configstore "^5.0.1"
Expand Down Expand Up @@ -2274,16 +2274,16 @@ cspell-util-bundle@^4.0.11:
resolved "https://registry.yarnpkg.com/cspell-util-bundle/-/cspell-util-bundle-4.0.11.tgz#838e493a33a063e2f28df0bd81bcf86c3cf15385"
integrity sha512-6AJRN0KbeTJB+IPpwKb11zFUVz2Q8Rgm4qmy/wsbhw6ICFfmgWG5Fr2OzJpZBCm8GJJg1Tjs/VZimSvCdnRj7g==

cspell@^4.0.60:
version "4.0.60"
resolved "https://registry.yarnpkg.com/cspell/-/cspell-4.0.60.tgz#3723ef23bb2f51bfce613ba471f2a147c9b6f566"
integrity sha512-OV9C9lR5plNuikzOLr04eqTChfL+sUFRHwrUgj2uLGJRf00bcAyryXzdojGp3DkCFR1tvJOZZr/ZQGbOb3Ga7A==
cspell@^4.0.61:
version "4.0.61"
resolved "https://registry.yarnpkg.com/cspell/-/cspell-4.0.61.tgz#8572d1e21c54db09689e5f55b808df5e6fd478a4"
integrity sha512-aRDKzACufP8aYZm7cQHUBlvEIyWFO7gaaVUm75oxFGpWmc4zqnoOcCnciMHadS1W1r0mqMNfBQ4w55OORCQWnA==
dependencies:
chalk "^2.4.2"
commander "^2.20.3"
comment-json "^1.1.3"
cspell-glob "^0.1.18"
cspell-lib "^4.1.26"
cspell-lib "^4.1.27"
fs-extra "^8.1.0"
gensequence "^3.1.1"
get-stdin "^7.0.0"
Expand Down Expand Up @@ -2818,9 +2818,9 @@ execa@^1.0.0:
strip-eof "^1.0.0"

execa@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/execa/-/execa-4.0.0.tgz#7f37d6ec17f09e6b8fc53288611695b6d12b9daf"
integrity sha512-JbDUxwV3BoT5ZVXQrSVbAiaXhXUkIwvbhPIwZ0N13kX+5yCzOhUNdocxB/UQRuYOHRYYwAxKYwJYc0T4D12pDA==
version "4.0.1"
resolved "https://registry.yarnpkg.com/execa/-/execa-4.0.1.tgz#988488781f1f0238cd156f7aaede11c3e853b4c1"
integrity sha512-SCjM/zlBdOK8Q5TIjOn6iEHZaPHFsMoTxXQ2nvUvtPnuohz3H2dIozSg+etNR98dGoYUp2ENSKLL/XaMmbxVgw==
dependencies:
cross-spawn "^7.0.0"
get-stream "^5.0.0"
Expand Down

0 comments on commit 2a0fc3b

Please sign in to comment.