Skip to content

webserver.log #

fn new #

fn new(db_path string) !Logger

fn new_backend #

fn new_backend(config DBBackendConfig) !DBBackend

factory for

struct DBBackend #

struct DBBackend {
pub:
	db sqlite.DB
}

struct DBBackendConfig #

@[params]
struct DBBackendConfig {
pub:
	db sqlite.DB
}

struct Log #

struct Log {
	id int @[primary; sql: serial]
pub:
	timestamp time.Time
pub mut:
	event   string
	subject string
	object  string
	message string // a custom message that can be attached to a log
}

struct LogFilter #

struct LogFilter {
	Log
	matches_all bool
	limit       int
}

struct Logger #

struct Logger {
	db_path string
	// DBBackend
}

fn (Logger) filter_logs #

fn (logger Logger) filter_logs(filter LogFilter) ![]Log

fn (Logger) new_log #

fn (logger Logger) new_log(log Log) !