Skip to content

Commit e1fd893

Browse files
committedMay 5, 2020
fix: silient mode should not output anything
1 parent eae8f19 commit e1fd893

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed
 

‎lib/log.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ class Logger {
4242
this.level = INFO;
4343

4444
if (silent) {
45-
this.level = WARN;
45+
this.level = FATAL + 10;
4646
}
4747

4848
if (this._debug) {

‎test/index.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ describe('hexo-log', () => {
281281
spy.args[0][0].should.contain(now.toISOString().substring(11, 23));
282282
});
283283

284-
it('options.silent - should ignore those level lower than warn', () => {
284+
it('options.silent - should not display anything', () => {
285285
const consoleTraceSpy = sinon.spy();
286286
const consoleDebugSpy = sinon.spy();
287287
const consoleInfoSpy = sinon.spy();
@@ -307,8 +307,8 @@ describe('hexo-log', () => {
307307
consoleTraceSpy.called.should.be.false;
308308
consoleDebugSpy.called.should.be.false;
309309
consoleInfoSpy.called.should.be.false;
310-
consoleWarnSpy.calledOnce.should.be.true;
311-
consoleErrorSpy.calledTwice.should.be.true;
310+
consoleWarnSpy.calledOnce.should.be.false;
311+
consoleErrorSpy.calledTwice.should.be.false;
312312
});
313313
});
314314

0 commit comments

Comments
 (0)
Please sign in to comment.