Example #1
0
func main() {
	logger, _ := log.NewLogger(os.Stdout, log.TIME_FORMAT_MILLISEC, log.LOG_FORMAT_POWERFUL, log.LogLevel_Debug)

	// go to localmode if arg is none.
	if len(os.Args) <= 1 {
		logger.Info("start servermode")

		err := HttpListenAndServe()
		logger.Info("server was end with err = ", err)
		return
	} else {
		src := GetStringsFromFile(os.Args[1])
		cvtr := NewConverter(src)
		if cvtr == nil {
			return
		}

		err := cvtr.DoConvert()
		if err != nil {
			logger.Debug(err)
			return
		}
		fmt.Print(cvtr.GetResult())
	}
}
Example #2
0
func main() {
	flag.Parse()
	logger, _ = log.NewLogger(os.Stdout, log.TIME_FORMAT_MILLISEC, log.LOG_FORMAT_POWERFUL, log.LogLevel_Debug)

	err := wMain()
	if err != nil {
		logger.Info(err)
		os.Exit(2)
		return
	}

	os.Exit(0)
	return
}