log.lua

Tue, 16 Jan 2018 16:39:48 +0000

author
Tuomo Valkonen <tuomov@iki.fi>
date
Tue, 16 Jan 2018 16:39:48 +0000
changeset 7
038275cd92ed
parent 3
b2df1b3f2c83
permissions
-rw-r--r--

Convert module stuff to lua 5.3

3
b2df1b3f2c83 Improvements
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
1
7
038275cd92ed Convert module stuff to lua 5.3
Tuomo Valkonen <tuomov@iki.fi>
parents: 3
diff changeset
2 --@module log
3
b2df1b3f2c83 Improvements
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
3
7
038275cd92ed Convert module stuff to lua 5.3
Tuomo Valkonen <tuomov@iki.fi>
parents: 3
diff changeset
4 local log={}
3
b2df1b3f2c83 Improvements
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
5
7
038275cd92ed Convert module stuff to lua 5.3
Tuomo Valkonen <tuomov@iki.fi>
parents: 3
diff changeset
6 local config=require("config")
038275cd92ed Convert module stuff to lua 5.3
Tuomo Valkonen <tuomov@iki.fi>
parents: 3
diff changeset
7
038275cd92ed Convert module stuff to lua 5.3
Tuomo Valkonen <tuomov@iki.fi>
parents: 3
diff changeset
8 function log.log(str)
3
b2df1b3f2c83 Improvements
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
9 if config.debug then
b2df1b3f2c83 Improvements
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
10 io.stderr:write(str)
b2df1b3f2c83 Improvements
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
11 end
b2df1b3f2c83 Improvements
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
12 end
7
038275cd92ed Convert module stuff to lua 5.3
Tuomo Valkonen <tuomov@iki.fi>
parents: 3
diff changeset
13
038275cd92ed Convert module stuff to lua 5.3
Tuomo Valkonen <tuomov@iki.fi>
parents: 3
diff changeset
14 return log

mercurial