disable logging

This commit is contained in:
Travis Shears 2025-10-06 10:42:09 +02:00
parent df6679edf5
commit 7cb2ac3e8f
3 changed files with 2 additions and 2 deletions

View file

@ -118,7 +118,7 @@ func (m model) View() string {
return s
}
var enableLogs bool = true
var enableLogs bool = false
func Run(config *gemlog.Config) {
if enableLogs {

View file

@ -1,32 +0,0 @@
package config
import (
"fmt"
"os"
"path/filepath"
gemlog "git.travisshears.com/travisshears/gemlog-cli/gemlog"
"gopkg.in/yaml.v3"
)
// LoadConfig reads and parses the YAML configuration file from ~/.config/gemlog-cli
func LoadConfig() (*gemlog.Config, error) {
homeDir, err := os.UserHomeDir()
if err != nil {
return nil, fmt.Errorf("failed to get user home directory: %w", err)
}
configPath := filepath.Join(homeDir, ".config", "gemlog-cli", "config.yml")
data, err := os.ReadFile(configPath)
if err != nil {
return nil, fmt.Errorf("failed to read config file %s: %w", configPath, err)
}
var config gemlog.Config
if err := yaml.Unmarshal(data, &config); err != nil {
return nil, fmt.Errorf("failed to parse YAML config: %w", err)
}
return &config, nil
}