-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(logging): add lualogging comaptible logging
- Loading branch information
Showing
7 changed files
with
39 additions
and
8 deletions.
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
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,18 @@ | ||
-- logging | ||
|
||
-- returns a LuaLogging compatible logger object. | ||
-- If LuaLogging was already loaded, it returns the defaultlogger, | ||
-- otherwise returns a stub. The stub has only no-op functions. | ||
|
||
local ll = package.loaded.logging | ||
if ll and type(ll) == "table" and ll.defaultLogger and | ||
tostring(ll._VERSION):find("LuaLogging") then | ||
-- default LuaLogging logger is available | ||
return ll.defaultLogger() | ||
else | ||
-- just use a stub logger with only no-op functions | ||
local nop = function() end | ||
return setmetatable({}, { | ||
__index = function(self, key) self[key] = nop return nop end | ||
}) | ||
end |
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
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