-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(ConsoleSink): allow non async console logging
The async attribute was being set to true by default using the or construct, making it impossible to pass false as value. Add missing test.
- Loading branch information
Showing
2 changed files
with
22 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
local log = require("structlog") | ||
local Console = log.sinks.Console | ||
|
||
local stub = require("luassert.stub") | ||
|
||
describe("Console constructor", function() | ||
local handler = {} | ||
stub(handler, "handle") | ||
|
||
it("should create an async console logger", function() | ||
local sink = Console(true) | ||
|
||
assert.True(sink.async) | ||
end) | ||
|
||
it("should create an non-async console logger", function() | ||
local sink = Console(false) | ||
|
||
assert.False(sink.async) | ||
end) | ||
end) |