package main
import (
"fmt"
"os"
"uos-syslog-ng-exporter/internal/exporter"
"uos-syslog-ng-exporter/pkg/utils"
"github.com/sirupsen/logrus"
)
var (
Name = "uos_syslog_ng_exporter"
Version = "1.0.0"
)
func main() {
logrus.SetLevel(logrus.DebugLevel)
cwd, err := os.Getwd()
if err != nil {
logrus.Warnf("Failed to get current working directory: %v", err)
} else {
logrus.Infof("Current working directory: %s", cwd)
}
defaultConfigPath := "/etc/uos-exporter/syslog-ng-exporter.yaml"
if utils.FileExists(defaultConfigPath) {
logrus.Infof("Default config file exists at: %s", defaultConfigPath)
} else {
logrus.Warnf("Default config file not found at: %s", defaultConfigPath)
}
logrus.Infof("Using config file (from command line): %s", *exporter.Configfile)
err = Run(Name, Version)
if err != nil {
fmt.Fprintln(os.Stderr, err)
os.Exit(1)
}
}