Example #1
0
func main() {

	// logfailo sukūrimas
	logFile, err := NewLogFile(os.Args[0])
	defer logFile.Close()
	log.SetOutput(logFile)

	// logfailo pildymo pradžia
	LogLn(os.Args[0], "started")
	LogLn(bigseparator)

	/*  //red := color.New(color.FgRed).SprintFunc() */

	PrintLn()
	LogLn("This is log file of", os.Args[0])
	LogLn(bigseparator)

	args := os.Args
	for _, arg := range args {
		switch arg {
		case "--debug":
			flags.Debug = true
		case "--verbose":
			flags.Verbose = true
		}
	}
	LogLn("args:", args, "\n")
	LogLn("flags.Debug:", flags.Debug, "\n")
	LogLn("flags.Verbose:", flags.Verbose, "\n")

	// darbo pradžia

	var confKeeper ConfKeeper
	err = confKeeper.Run()
	if err != nil {
		PrintLn(err.Error(), "\n")
	}
	PrintLn("Press any key to exit...")
	keyboard.GetSingleKey()

}
Example #2
0
func main() {
	args := os.Args
	for _, arg := range args {
		switch arg {
		case "--debug":
			flags.Debug = true
		case "--verbose":
			flags.Verbose = true
		}
	}

	// logfailo sukūrimas
	logFile, err := NewLogFile(fRunningFile)
	defer logFile.Close()
	log.SetOutput(logFile)

	Debug("\nargs: ", args, "\n\n")
	Debug("flags.Debug: ", flags.Debug, "\n\n")
	Debug("flags.Verbose: ", flags.Verbose, "\n\n")

	// logfailo pildymo pradžia
	Debug(fRunningFile, " started\n")
	Out("\n")

	// darbo pradžia

	var confKeeper ConfKeeper

	err = confKeeper.Run()
	if err != nil {
		Out(err.Error(), "\n\n")
	}
	Out("Press any key to exit...\n")
	keyboard.GetSingleKey()

}