refactor: migrate all log statements to structured logger calls for improved observability

This commit is contained in:
2026-08-15 00:15:27 -07:00
parent 86a092ecd3
commit 150e3dfbd5
6 changed files with 43 additions and 31 deletions
+4 -5
View File
@@ -30,8 +30,7 @@ func newRootCmd() *cobra.Command {
logger.Log.Info("==========================================================")
logger.Log.Info("🚀 Starting Hireme (GJCC) Job Application Command Center")
logger.Log.Info("==========================================================")
logger.Log.Infof("[Config] Port: %s | DB Path: %s | Target Config: %s | Active LLM: %s | Log Level: %s",
cfg.Port, cfg.DBPath, cfg.TargetConfig, cfg.LLMProvider, cfg.LogLevel)
logger.Log.Infow("Starting Hireme", "component", "Config", "port", cfg.Port, "db_path", cfg.DBPath, "target_config", cfg.TargetConfig, "llm", cfg.LLMProvider, "log_level", cfg.LogLevel)
// Ensure DB directory exists
dbDir := filepath.Dir(cfg.DBPath)
@@ -48,7 +47,7 @@ func newRootCmd() *cobra.Command {
// Load targets from YAML config if database is empty
if err := database.LoadTargetsFromYAML(cfg.TargetConfig); err != nil {
logger.Log.Errorf("[Main] Target YAML loading status: %v", err)
logger.Log.Errorw("Target YAML loading failed", "component", "Main", "error", err)
}
// Initialize LLM Analyzer
@@ -60,7 +59,7 @@ func newRootCmd() *cobra.Command {
// Load filter configuration
filterCfg, err := config.LoadFilterConfig(cfg.FilterConfig)
if err != nil {
logger.Log.Fatalf("Failed to load filter config: %v", err)
logger.Log.Fatalw("Failed to load filter config", "component", "Main", "error", err)
}
// 4. Initialize Worker Pool
@@ -73,7 +72,7 @@ func newRootCmd() *cobra.Command {
server.RegisterRoutes(mux)
addr := fmt.Sprintf(":%s", cfg.Port)
logger.Log.Infof("✨ Hireme Command Center is live at http://localhost:%s", cfg.Port)
logger.Log.Infow("Hireme Command Center is live", "component", "Main", "url", fmt.Sprintf("http://localhost:%s", cfg.Port))
return http.ListenAndServe(addr, mux)
},
}