File tree Expand file tree Collapse file tree 1 file changed +45
-5
lines changed Expand file tree Collapse file tree 1 file changed +45
-5
lines changed Original file line number Diff line number Diff line change 11local M = {}
2-
3- M .debug = function (msg ) end
4- M .info = function (msg ) end
5- M .warn = function (msg ) end
6- M .error = function (msg ) end
2+ local log
3+ function M .info (msg )
4+ if not log then
5+ local ok , l = pcall (require , ' logger' )
6+ if ok then
7+ log = l .derive (' tasks' )
8+ log .info (msg )
9+ end
10+ else
11+ log .info (msg )
12+ end
13+ end
14+ function M .debug (msg )
15+ if not log then
16+ local ok , l = pcall (require , ' logger' )
17+ if ok then
18+ log = l .derive (' tasks' )
19+ log .debug (msg )
20+ end
21+ else
22+ log .debug (msg )
23+ end
24+ end
25+ function M .warn (msg )
26+ if not log then
27+ local ok , l = pcall (require , ' logger' )
28+ if ok then
29+ log = l .derive (' tasks' )
30+ log .warn (msg )
31+ end
32+ else
33+ log .warn (msg )
34+ end
35+ end
36+ function M .error (msg )
37+ if not log then
38+ local ok , l = pcall (require , ' logger' )
39+ if ok then
40+ log = l .derive (' tasks' )
41+ log .error (msg )
42+ end
43+ else
44+ log .error (msg )
45+ end
46+ end
747
848return M
You can’t perform that action at this time.
0 commit comments