Closed chelm closed 8 years ago
cc @ngoldman
The previous version of the logger used this (ugly solution on purpose...)
var logpath = config.logfile.split('/')
logpath.splice(-1,1)
logpath = logpath.join('/')
This correctly removes the file name and gets the base url. I think the better solution would be to pop()
and rejoin the array.
actually the correct thing to do is s/splice/slice/
Would probably be best to use something like https://nodejs.org/api/path.html#path_path_parse_pathstring rather than doing a lot of manual string manipulation to figure out the path
oh good call @ngoldman
psh fancy high-falutin stdlib
path.parse, path.format, and path.join are pretty handy for dealing with path stuff and they work cross-platform (linux, os x, win)
This line https://github.com/koopjs/koop/blob/master/lib/Logger.js#L11 has broke some of the provider tests.
The issue (I'm suspecting) is that splice call is not returning what we think it should return.