aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authors-ol <s-ol@users.noreply.github.com>2020-04-11 07:47:24 +0000
committers-ol <s-ol@users.noreply.github.com>2020-04-12 16:12:46 +0000
commit05df5081dff5d242873ad430c1132fb588c715ea (patch)
tree02f333c3c09a00dc48c2f3a4a02d875aa18d7c21
parentrelease v0.1-rc2 (diff)
downloadalive-05df5081dff5d242873ad430c1132fb588c715ea.tar.gz
alive-05df5081dff5d242873ad430c1132fb588c715ea.zip
remove source files in log (traceback format isn't portable)
-rw-r--r--docs/guide.md4
-rw-r--r--logger.moon11
2 files changed, 5 insertions, 10 deletions
diff --git a/docs/guide.md b/docs/guide.md
index 4f3b75b..f9fb3f5 100644
--- a/docs/guide.md
+++ b/docs/guide.md
@@ -67,7 +67,7 @@ To run the copilot, open a shell and navigate into the repository. You can now
run the `hello.alv` example script using the following command:
$ moon init.moon hello.alv
- [copilot.moon:76 ] hello.alv changed at 1585138092
+ hello.alv changed at 1585138092
hello
world!
hello
@@ -87,7 +87,7 @@ it onto the `copilot.bat` file in the folder, or by running the following
command from the main directory in `cmd.exe`:
C:\…\alive>copilot.bat hello.alv
- [copilot.moon:76 ] hello.alv changed at 1585138092
+ hello.alv changed at 1585138092
hello
world!
hello
diff --git a/logger.moon b/logger.moon
index b187a95..cd41cc8 100644
--- a/logger.moon
+++ b/logger.moon
@@ -14,23 +14,18 @@ class Logger
mklog = (max_level) ->
new: (level='log') =>
@level = levels[level] or level
- @prefix = ' '
+ @prefix = ''
for name, level in pairs levels
@[name] = (first, ...) =>
return unless @level <= level
where = debug.traceback '', 2
- line = where\match '^.-\n%s+([%w:/%.]+): '
- line = (line\match '[%./]*(.*)') or line
- line = (line\match '^core/(.*)') or line
- line ..= string.rep ' ', 20-#line
-
if level == levels.error or @level == levels.debug
- print "[#{line}]#{@prefix}#{first}", ...
+ print @prefix .. first, ...
print where
else
- print "[#{line}]#{@prefix}#{first}", ...
+ print @prefix .. first, ...
if level == levels.print
@push = (fn, ...) => fn ...