Sfoglia il codice sorgente

Don't override package name

tags/v0.10.3
Daniel Oaks 6 anni fa
parent
commit
2cbbec567c
1 ha cambiato i file con 9 aggiunte e 9 eliminazioni
  1. 9
    9
      oragono.go

+ 9
- 9
oragono.go Vedi File

47
 		log.Fatal("Config file did not load successfully:", err.Error())
47
 		log.Fatal("Config file did not load successfully:", err.Error())
48
 	}
48
 	}
49
 
49
 
50
-	logger, err := logger.NewManager(config.Logging)
50
+	logman, err := logger.NewManager(config.Logging)
51
 	if err != nil {
51
 	if err != nil {
52
 		log.Fatal("Logger did not load successfully:", err.Error())
52
 		log.Fatal("Logger did not load successfully:", err.Error())
53
 	}
53
 	}
97
 	} else if arguments["run"].(bool) {
97
 	} else if arguments["run"].(bool) {
98
 		rand.Seed(time.Now().UTC().UnixNano())
98
 		rand.Seed(time.Now().UTC().UnixNano())
99
 		if !arguments["--quiet"].(bool) {
99
 		if !arguments["--quiet"].(bool) {
100
-			logger.Info("startup", fmt.Sprintf("Oragono v%s starting", irc.SemVer))
100
+			logman.Info("startup", fmt.Sprintf("Oragono v%s starting", irc.SemVer))
101
 		}
101
 		}
102
 
102
 
103
 		// profiling
103
 		// profiling
104
 		if config.Debug.StackImpact.Enabled {
104
 		if config.Debug.StackImpact.Enabled {
105
 			if config.Debug.StackImpact.AgentKey == "" || config.Debug.StackImpact.AppName == "" {
105
 			if config.Debug.StackImpact.AgentKey == "" || config.Debug.StackImpact.AppName == "" {
106
-				logger.Error("startup", "Could not start StackImpact - agent-key or app-name are undefined")
106
+				logman.Error("startup", "Could not start StackImpact - agent-key or app-name are undefined")
107
 				return
107
 				return
108
 			}
108
 			}
109
 
109
 
111
 			agent.Start(stackimpact.Options{AgentKey: config.Debug.StackImpact.AgentKey, AppName: config.Debug.StackImpact.AppName})
111
 			agent.Start(stackimpact.Options{AgentKey: config.Debug.StackImpact.AgentKey, AppName: config.Debug.StackImpact.AppName})
112
 			defer agent.RecordPanic()
112
 			defer agent.RecordPanic()
113
 
113
 
114
-			logger.Info("startup", fmt.Sprintf("StackImpact profiling started as %s", config.Debug.StackImpact.AppName))
114
+			logman.Info("startup", fmt.Sprintf("StackImpact profiling started as %s", config.Debug.StackImpact.AppName))
115
 		}
115
 		}
116
 
116
 
117
 		// warning if running a non-final version
117
 		// warning if running a non-final version
118
 		if strings.Contains(irc.SemVer, "unreleased") {
118
 		if strings.Contains(irc.SemVer, "unreleased") {
119
-			logger.Warning("startup", "You are currently running an unreleased beta version of Oragono that may be unstable and could corrupt your database.\nIf you are running a production network, please download the latest build from https://oragono.io/downloads.html and run that instead.")
119
+			logman.Warning("startup", "You are currently running an unreleased beta version of Oragono that may be unstable and could corrupt your database.\nIf you are running a production network, please download the latest build from https://oragono.io/downloads.html and run that instead.")
120
 		}
120
 		}
121
 
121
 
122
-		server, err := irc.NewServer(config, logger)
122
+		server, err := irc.NewServer(config, logman)
123
 		if err != nil {
123
 		if err != nil {
124
-			logger.Error("startup", fmt.Sprintf("Could not load server: %s", err.Error()))
124
+			logman.Error("startup", fmt.Sprintf("Could not load server: %s", err.Error()))
125
 			return
125
 			return
126
 		}
126
 		}
127
 		if !arguments["--quiet"].(bool) {
127
 		if !arguments["--quiet"].(bool) {
128
-			logger.Info("startup", "Server running")
129
-			defer logger.Info("shutdown", fmt.Sprintf("Oragono v%s exiting", irc.SemVer))
128
+			logman.Info("startup", "Server running")
129
+			defer logman.Info("shutdown", fmt.Sprintf("Oragono v%s exiting", irc.SemVer))
130
 		}
130
 		}
131
 		server.Run()
131
 		server.Run()
132
 	}
132
 	}

Loading…
Annulla
Salva