Commit graph

8 commits

Author SHA1 Message Date
Piper Pentagram
0c64670c33 Use absolute paths where possible
bingobot blindly uses the shell's working dir to write logs and read
configs. This change introduces the following changes:

1. start.sh now determines the project root's absolute path before
   reading the token file and starting the app.
2. the config package now determine's the executable's working directory
   (rather than assuming it's the same as the shell's) before loading
   configs. It also now exposes this for use in other packages.
3. the logging package now uses config.GetWorkingDir() to determine
   where to write logs.
2024-11-14 11:16:30 -08:00
Piper Pentagram
9f678b6be7 Remove source info from log messages
slog.HandlerOptions.AddSource is a cool feature, but since we moved the
logger to a separate package it no longer works. It now always shows
source info for the log package, rather than the code that called it.

This change removes it.
2024-11-13 17:02:47 -08:00
piper pentagram
07223320af Move the config package to a singleton pattern 2024-11-13 22:03:57 +00:00
Piper Pentagram
cb55b48893 Add logging.Debug() function 2024-11-08 17:07:55 -08:00
Piper Pentagram
665717d9e7 Make logging package usage less tedious
Before, we were exposing a Logger as logging.Log. This works, but
results in code calling Logger.Log.Info() which is a little wordy.

Instead, the logger is now kept private and we expose Info, Warn and
Error as public functions that wrap logger.Info, logger.Warn and
logger.Error.
2024-11-08 14:33:57 -08:00
Piper Pentagram
f86efba6bd Rename redundant init function
This change renames logging.InitLogger() to logging.Init().
2024-11-08 14:00:27 -08:00
Piper Pentagram
a82ba0f51b Use a singleton pattern for logging
This change migrates the internal/logging package to a singleton
pattern. It now exports a Log variable which can be acquired from any
other package.
2024-11-08 13:54:19 -08:00
Piper Pentagram
450d425b04 move config & logging packages into internal submodules 2024-11-06 16:01:38 -08:00