about summary refs log tree commit diff stats
path: root/src/utils
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2023-05-01 09:48:56 +0200
committerbptato <nincsnevem662@gmail.com>2023-05-01 09:48:56 +0200
commite0a8b27068ac8fc61a243bae685c23a14976f619 (patch)
tree61b9f50aeeb0a35c7ecab7dc87db93461d1b3860 /src/utils
parent90d10281be21c174e0f1528a7d893e126c78a405 (diff)
downloadchawan-e0a8b27068ac8fc61a243bae685c23a14976f619.tar.gz
Add elog
Like eprint, but writes to `a'
Diffstat (limited to 'src/utils')
-rw-r--r--src/utils/eprint.nim16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/utils/eprint.nim b/src/utils/eprint.nim
index 1564142e..fab56464 100644
--- a/src/utils/eprint.nim
+++ b/src/utils/eprint.nim
@@ -20,3 +20,19 @@ func eprint*(s: varargs[string, `$`]) = {.cast(noSideEffect), cast(tags: []), ca
       o &= x
     o &= '\n'
     stderr.write(o)
+
+func elog*(s: varargs[string, `$`]) = {.cast(noSideEffect), cast(tags: []), cast(raises: []).}:
+  var f: File
+  if not open(f, "a", fmAppend):
+    return
+  var a = false
+  var o = ""
+  for x in s:
+    if not a:
+      a = true
+    else:
+      o &= ' '
+    o &= x
+  o &= '\n'
+  f.write(o)
+  close(f)
re>91fcf47 ^
74b1bb3 ^

97fb7e9 ^
91fcf47 ^
07f426b ^










a0025c8 ^
ac19e22

a0025c8 ^

ac19e22

9cf72e3 ^
a0025c8 ^

ac19e22




a0025c8 ^
ac19e22


a0025c8 ^
9cf72e3 ^

ac19e22



9cf72e3 ^
a0025c8 ^


ac19e22
a0025c8 ^

ac19e22

a0025c8 ^
9cf72e3 ^
ac19e22

a0025c8 ^

ac19e22

a0025c8 ^
74b1bb3 ^
ac19e22
8be733f ^
04eb4cd ^
c6016ff ^
ac19e22
8be733f ^

c6016ff ^
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82