tmp: add log files

This commit is contained in:
Aliberk Sandıkçı 2023-07-30 13:06:03 +03:00
parent 8bf6292a4b
commit fc19e3659f
Signed by: asandikci
GPG key ID: 25C67A03B5666BC1
2 changed files with 4 additions and 0 deletions

View file

@ -28,9 +28,11 @@ func main() {
log.Print("- - - - - - - - - - - - - - -") log.Print("- - - - - - - - - - - - - - -")
log.Print("daemon started") log.Print("daemon started")
log.Print("log1")
for true { for true {
Info() Info()
log.Print("log2")
time.Sleep(100 * time.Millisecond) time.Sleep(100 * time.Millisecond)
} }

View file

@ -21,11 +21,13 @@ func checkExists(path string) (bool, error) {
} }
func Info() { func Info() {
log.Print("log3")
// A SAMPLE COMMAND FOR LOGGING OS INFORMATION TO A DEDICATED FILE // A SAMPLE COMMAND FOR LOGGING OS INFORMATION TO A DEDICATED FILE
userhome, err := os.UserHomeDir() // TODO $HOME is not defined while running as daemon !!! userhome, err := os.UserHomeDir() // TODO $HOME is not defined while running as daemon !!!
if err != nil { if err != nil {
log.Fatal(err) log.Fatal(err)
} }
log.Print("log4")
// userhome := "/home/asandikci" // TEMPORARY // userhome := "/home/asandikci" // TEMPORARY
configDir := userhome + "/.config/" + ProgramName + "/" configDir := userhome + "/.config/" + ProgramName + "/"