feat: add cmd flags
This commit is contained in:
+1
-10
@@ -12,7 +12,7 @@ import (
|
||||
func main() {
|
||||
// grab the environment variables from the runtime environment
|
||||
// unfortunately since its before we configure the loglevel, we cannot use slog logging in those functions
|
||||
env := bootstrap.GrabEnvironment()
|
||||
env := bootstrap.LoadConfig()
|
||||
// configure the logger so we have nice json
|
||||
level := utility.ParseSlogLevel(env.LogLevel) // defaults to Info
|
||||
logger := slog.New(slog.NewJSONHandler(os.Stdout, &slog.HandlerOptions{
|
||||
@@ -23,15 +23,6 @@ func main() {
|
||||
// print our running environment variable set
|
||||
slog.Debug("displaying environment variables", "environment", env)
|
||||
|
||||
// TO DO, allow cmd args parsing
|
||||
|
||||
// checking directories to ensure its expected environment is ready
|
||||
slog.Debug("checking if directories are present")
|
||||
if err := bootstrap.EnsureOperation(env.DataDirectory); err != nil {
|
||||
slog.Error("failed to ensure the operating environment", "error", err)
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
// initiating the database connection for which we safe things
|
||||
slog.Info("kicking off database connection")
|
||||
db, err := database.KickoffDatabase(env.DataDirectory)
|
||||
|
||||
Reference in New Issue
Block a user