mirror of
https://github.com/rojo-rbx/rojo.git
synced 2026-10-22 13:21:38 +00:00
Vertically align output for monospace consoles
This commit is contained in:
parent
fff71e1de0
commit
01dd603bd5
1 changed files with 7 additions and 3 deletions
|
|
@ -26,25 +26,29 @@ local function addTags(tag, message)
|
||||||
return tag .. message:gsub("\n", "\n" .. tag)
|
return tag .. message:gsub("\n", "\n" .. tag)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local INFO_TAG = (" "):rep(15) .. "[Rojo-Info] "
|
||||||
|
local TRACE_TAG = (" "):rep(15) .. "[Rojo-Trace] "
|
||||||
|
local WARN_TAG = "[Rojo-Warn] "
|
||||||
|
|
||||||
local Log = {}
|
local Log = {}
|
||||||
|
|
||||||
Log.Level = Level
|
Log.Level = Level
|
||||||
|
|
||||||
function Log.trace(template, ...)
|
function Log.trace(template, ...)
|
||||||
if getLogLevel() >= Level.Trace then
|
if getLogLevel() >= Level.Trace then
|
||||||
print(addTags("[Rojo-Trace] ", string.format(template, ...)))
|
print(addTags(TRACE_TAG, string.format(template, ...)))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function Log.info(template, ...)
|
function Log.info(template, ...)
|
||||||
if getLogLevel() >= Level.Info then
|
if getLogLevel() >= Level.Info then
|
||||||
print(addTags("[Rojo-Info] ", string.format(template, ...)))
|
print(addTags(INFO_TAG, string.format(template, ...)))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function Log.warn(template, ...)
|
function Log.warn(template, ...)
|
||||||
if getLogLevel() >= Level.Warning then
|
if getLogLevel() >= Level.Warning then
|
||||||
warn(addTags("[Rojo-Warn] ", string.format(template, ...)))
|
warn(addTags(WARN_TAG, string.format(template, ...)))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue