summaryrefslogtreecommitdiff
path: root/src/lua-script/script.lua
diff options
context:
space:
mode:
authorsanine <sanine.not@pm.me>2022-01-04 12:40:29 -0600
committersanine <sanine.not@pm.me>2022-01-04 12:40:29 -0600
commita026db7389c15eb5a8905e6f04eb3a92bf31f9bc (patch)
treeb8d0ff6049db05acb8068ce1cc0e1dcd40fc0797 /src/lua-script/script.lua
parent0e84036b1b727356d433373b017204a8d575d2e4 (diff)
improve logging and move per-function logs to TRACE
Diffstat (limited to 'src/lua-script/script.lua')
-rw-r--r--src/lua-script/script.lua8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/lua-script/script.lua b/src/lua-script/script.lua
index ef2ef8f..ccfe902 100644
--- a/src/lua-script/script.lua
+++ b/src/lua-script/script.lua
@@ -1,4 +1,5 @@
return function(config)
+ local fmt = string.format
--------------------------------
--
@@ -47,8 +48,7 @@ return function(config)
function setup(config)
argent.log('debug', 'begin setup')
- local fmt = string.format
-
+
argent.config = {
site_directory = add_end_slash(config.site_directory) or 'site/',
output_directory = add_end_slash(config.output_directory) or 'public/',
@@ -115,9 +115,11 @@ return function(config)
function obliterate_file(file, parent)
if argent.config.keep[file] then
+ argent.log('debug', fmt('retaining file %q', file))
return true
end
+ argent.log('debug', fmt('removing file %q', file))
os.remove(argent.config.output_directory..parent..file)
return false
end
@@ -125,9 +127,11 @@ return function(config)
function obliterate_dir(dir, parent)
if argent.config.keep[strip_end_slash(dir)] then
+ argent.log('debug', fmt('retaining directory %q', dir))
return true
end
+ argent.log('debug', fmt('obliterating files in %q', parent..dir))
return obliterate_directory(dir, parent)
end