aboutsummaryrefslogtreecommitdiff
path: root/examples/log
diff options
context:
space:
mode:
Diffstat (limited to 'examples/log')
-rw-r--r--examples/log/log.tm10
1 files changed, 5 insertions, 5 deletions
diff --git a/examples/log/log.tm b/examples/log/log.tm
index f537b850..89557e55 100644
--- a/examples/log/log.tm
+++ b/examples/log/log.tm
@@ -3,7 +3,7 @@ use <stdio.h>
timestamp_format := CString("%F %T")
-logfiles := {:Path}
+logfiles := @{:Path}
func _timestamp(->Text):
c_str := inline C:CString {
@@ -17,22 +17,22 @@ func _timestamp(->Text):
func info(text:Text, newline=yes):
say("$\[2]⚫ $text$\[]", newline)
- for file in logfiles:
+ for file in logfiles[]:
file:append("$(_timestamp()) [info] $text$\n")
func debug(text:Text, newline=yes):
say("$\[32]🟢 $text$\[]", newline)
- for file in logfiles:
+ for file in logfiles[]:
file:append("$(_timestamp()) [debug] $text$\n")
func warn(text:Text, newline=yes):
say("$\[33;1]🟡 $text$\[]", newline)
- for file in logfiles:
+ for file in logfiles[]:
file:append("$(_timestamp()) [warn] $text$\n")
func error(text:Text, newline=yes):
say("$\[31;1]🔴 $text$\[]", newline)
- for file in logfiles:
+ for file in logfiles[]:
file:append("$(_timestamp()) [error] $text$\n")
func add_logfile(file:Path):