diff options
author | terminaldweller <devi@terminaldweller.com> | 2024-09-01 02:13:40 +0000 |
---|---|---|
committer | terminaldweller <devi@terminaldweller.com> | 2024-09-01 02:13:40 +0000 |
commit | 7c8e0160eefa9f90b74b729086dc44f108539083 (patch) | |
tree | ecbb9760ead142557ba6cbb4f46d6a0420f7ee28 /types.go | |
parent | fixed a bug where we would still get previously seen feeds, updated the readme (diff) | |
download | milla-7c8e0160eefa9f90b74b729086dc44f108539083.tar.gz milla-7c8e0160eefa9f90b74b729086dc44f108539083.zip |
added the url to the rss output. fixed a bug with the rss feeds where different rss feeds where not being handled correctly. added new logging functions
Diffstat (limited to '')
-rw-r--r-- | types.go | 20 |
1 files changed, 20 insertions, 0 deletions
@@ -2,6 +2,8 @@ package main import ( "context" + "log" + "runtime" "time" "github.com/jackc/pgx/v5/pgxpool" @@ -191,3 +193,21 @@ type RSSConfig struct { Feeds []FeedConfig `json:"feeds"` Period int `json:"period"` } + +func LogError(err error) { + fn, file, line, ok := runtime.Caller(1) + if ok { + log.Printf("%s: %s-%d >>> %v", runtime.FuncForPC(fn).Name(), file, line, err) + } else { + log.Print(err) + } +} + +func LogErrorFatal(err error) { + fn, file, line, ok := runtime.Caller(1) + if ok { + log.Fatalf("%s: %s-%d >>> %v", runtime.FuncForPC(fn).Name(), file, line, err) + } else { + log.Fatal(err) + } +} |