Compare commits

..

15 commits

Author SHA1 Message Date
b47d78c41c chore: remove outdated tests
Some checks are pending
ci/woodpecker/pr/build Pipeline is pending
ci/woodpecker/pr/docker Pipeline is pending
ci/woodpecker/pr/docs Pipeline is pending
ci/woodpecker/pr/lint Pipeline is pending
ci/woodpecker/pr/man Pipeline is pending
ci/woodpecker/pr/test Pipeline is pending
2023-01-14 20:54:39 +01:00
a135068b31 chore: please the formatter 2023-01-14 20:48:14 +01:00
2f4acf59e3 fix(cron): fix some bugs 2023-01-14 20:46:03 +01:00
da5a77e489 feat(cron): proper parse error handling 2023-01-14 19:08:35 +01:00
8c0315dea6 refactor(cron): make next function infallible 2023-01-14 18:51:01 +01:00
243002f282 fix(cron): ensure valid day values; some other stuff 2023-01-14 18:44:33 +01:00
f63cbd77d3 refactor: make cron.expression into cron module 2023-01-14 16:54:14 +01:00
fbc18386e2 feat(cron): some bug fixes & formatting 2023-01-14 15:03:11 +01:00
292e43944e feat(cron): pass original expression tests 2023-01-14 14:18:41 +01:00
191ea1f2fe feat(cron): first step of replacing cron with C implementation 2023-01-13 21:49:30 +01:00
d8e3dcb34f chore: remove old cron daemon code 2023-01-13 19:04:41 +01:00
85ea7166fb feat(cron): next function in C 2023-01-12 21:31:32 +01:00
ee262a2fbc feat(cron): rest of parser in C 2023-01-12 21:08:58 +01:00
c3f7f11686 feat(cron): mostly written C expression parser 2023-01-12 20:32:48 +01:00
7490668b44 wip 2023-01-12 12:26:12 +01:00
2 changed files with 28 additions and 30 deletions

View file

@ -1,36 +1,35 @@
module agent
import log
// log a message with the given level
pub fn (mut d AgentDaemon) log(msg string, level log.Level) {
lock d.logger {
d.logger.send_output(msg, level)
}
}
// lfatal create a log message with the fatal level
pub fn (mut d AgentDaemon) lfatal(msg string) {
lock d.logger {
d.logger.fatal(msg)
}
d.log(msg, log.Level.fatal)
}
// lerror create a log message with the error level
pub fn (mut d AgentDaemon) lerror(msg string) {
lock d.logger {
d.logger.error(msg)
}
d.log(msg, log.Level.error)
}
// lwarn create a log message with the warn level
pub fn (mut d AgentDaemon) lwarn(msg string) {
lock d.logger {
d.logger.warn(msg)
}
d.log(msg, log.Level.warn)
}
// linfo create a log message with the info level
pub fn (mut d AgentDaemon) linfo(msg string) {
lock d.logger {
d.logger.info(msg)
}
d.log(msg, log.Level.info)
}
// ldebug create a log message with the debug level
pub fn (mut d AgentDaemon) ldebug(msg string) {
lock d.logger {
d.logger.debug(msg)
}
d.log(msg, log.Level.debug)
}

View file

@ -1,36 +1,35 @@
module web
import log
// log reate a log message with the given level
pub fn (mut ctx Context) log(msg string, level log.Level) {
lock ctx.logger {
ctx.logger.send_output(msg, level)
}
}
// lfatal create a log message with the fatal level
pub fn (mut ctx Context) lfatal(msg string) {
lock ctx.logger {
ctx.logger.fatal(msg)
}
ctx.log(msg, log.Level.fatal)
}
// lerror create a log message with the error level
pub fn (mut ctx Context) lerror(msg string) {
lock ctx.logger {
ctx.logger.error(msg)
}
ctx.log(msg, log.Level.error)
}
// lwarn create a log message with the warn level
pub fn (mut ctx Context) lwarn(msg string) {
lock ctx.logger {
ctx.logger.warn(msg)
}
ctx.log(msg, log.Level.warn)
}
// linfo create a log message with the info level
pub fn (mut ctx Context) linfo(msg string) {
lock ctx.logger {
ctx.logger.info(msg)
}
ctx.log(msg, log.Level.info)
}
// ldebug create a log message with the debug level
pub fn (mut ctx Context) ldebug(msg string) {
lock ctx.logger {
ctx.logger.debug(msg)
}
ctx.log(msg, log.Level.debug)
}