summaryrefslogtreecommitdiff
path: root/xmake/core/base/utils.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2017-12-07 22:46:25 +0800
committerruki <[email protected]>2017-12-08 14:10:23 +0800
commitcb44535305f596bd757ffb58e5ae3cde6d3589fa (patch)
tree343f0ff9287b90204a6a000e0af1a7a1ed6c640b /xmake/core/base/utils.lua
parentabe87994168053e4f420a8b7ab286c65b546eaae (diff)
improve log and add color attrs for curses
Diffstat (limited to 'xmake/core/base/utils.lua')
-rw-r--r--xmake/core/base/utils.lua18
1 files changed, 9 insertions, 9 deletions
diff --git a/xmake/core/base/utils.lua b/xmake/core/base/utils.lua
index e28938648..8a31330e7 100644
--- a/xmake/core/base/utils.lua
+++ b/xmake/core/base/utils.lua
@@ -78,7 +78,7 @@ function utils.print(format, ...)
utils._print(message)
-- write to the log file
- log.printv(message)
+ log:printv(message)
end
-- print format string without newline
@@ -94,7 +94,7 @@ function utils.printf(format, ...)
utils._iowrite(message)
-- write to the log file
- log.write(message)
+ log:write(message)
end
-- print format string and colors with newline
@@ -110,8 +110,8 @@ function utils.cprint(format, ...)
utils._print(colors.translate(message))
-- write to the log file
- if log.file() then
- log.printv(colors.ignore(message))
+ if log:file() then
+ log:printv(colors.ignore(message))
end
end
@@ -128,8 +128,8 @@ function utils.cprintf(format, ...)
utils._iowrite(colors.translate(message))
-- write to the log file
- if log.file() then
- log.write(colors.ignore(message))
+ if log:file() then
+ log:write(colors.ignore(message))
end
end
@@ -148,7 +148,7 @@ function utils.verror(format, ...)
-- enable verbose?
if option.get("verbose") and format ~= nil then
utils.cprint("${bright red}error: ${clear}" .. string.tryformat(format, ...))
- log.flush()
+ log:flush()
end
end
@@ -158,7 +158,7 @@ function utils.error(format, ...)
-- trace
if format ~= nil then
utils.cprint("${bright red}error: ${clear}" .. string.tryformat(format, ...))
- log.flush()
+ log:flush()
end
end
@@ -182,7 +182,7 @@ function utils.warning(format, ...)
end
-- flush
- log.flush()
+ log:flush()
end
-- ifelse, a? b : c