diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2024-11-09 17:26:01 -0500 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2024-11-09 17:26:01 -0500 |
| commit | 145a078387b8bce5e8e3c93c333c030aa7455e4c (patch) | |
| tree | 48e113e07888a546bdf9543db2a19587aeef3071 /examples/log | |
| parent | 8dd51a113ead1fe88c80af9165219ca5398715f6 (diff) | |
Make the compiler stricter about not promoting local value variables to
pointers
Diffstat (limited to 'examples/log')
| -rw-r--r-- | examples/log/log.tm | 10 |
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): |
