- Timestamp:
- 03/19/09 17:30:33 (16 years ago)
- Location:
- trunk/sources
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Hive.Client.Common/Logging.cs
r782 r1371 40 40 /// </summary> 41 41 /// <returns>the instance of the logger</returns> 42 public static Logging GetInstance() { 42 public static Logging Instance { 43 get { 44 if (instance == null) 45 instance = new Logging(); 46 return instance; 47 } 48 set {} 49 } 50 51 static Logging GetInstance() { 43 52 if (instance == null) 44 53 instance = new Logging(); -
trunk/sources/HeuristicLab.Hive.Client.Communication/WcfService.cs
r1367 r1371 93 93 ConnectionRestored(this, new EventArgs()); 94 94 } 95 catch (Exception ex) { 96 //Todo: Rename to HandleNetworkError 97 NetworkErrorHandling(ex); 95 catch (Exception ex) { 96 HandleNetworkError(ex); 98 97 } 99 98 } … … 126 125 /// </summary> 127 126 /// <param name="e">The Exception</param> 128 private void NetworkErrorHandling(Exception e) {127 private void HandleNetworkError(Exception e) { 129 128 ConnState = NetworkEnum.WcfConnState.Failed; 130 Logging. GetInstance().Error(this.ToString(), "exception: ", e);129 Logging.Instance.Error(this.ToString(), "exception: ", e); 131 130 } 132 131 … … 146 145 LoginCompleted(sender, e); 147 146 else 148 NetworkErrorHandling(e.Error.InnerException);147 HandleNetworkError(e.Error.InnerException); 149 148 } 150 149 … … 154 153 Response res = proxy.Login(clientInfo); 155 154 ConnState = NetworkEnum.WcfConnState.Loggedin; 156 Logging. GetInstance().Info(this.ToString(), res.StatusMessage);155 Logging.Instance.Info(this.ToString(), res.StatusMessage); 157 156 } 158 157 } 159 158 catch (Exception e) { 160 NetworkErrorHandling(e);159 HandleNetworkError(e); 161 160 } 162 161 } … … 177 176 SendJobCompleted(sender, e); 178 177 else 179 NetworkErrorHandling(e.Error);178 HandleNetworkError(e.Error); 180 179 } 181 180 #endregion … … 194 193 ProcessJobResultCompleted(sender, e); 195 194 else 196 NetworkErrorHandling(e.Error);195 HandleNetworkError(e.Error); 197 196 } 198 197 … … 214 213 SendHeartBeatCompleted(sender, e); 215 214 else 216 NetworkErrorHandling(e.Error);215 HandleNetworkError(e.Error); 217 216 } 218 217 -
trunk/sources/HeuristicLab.Hive.Client.Core/Core.cs
r1368 r1371 69 69 abortRequested = false; 70 70 71 Logging. GetInstance().Info(this.ToString(), "Hive Client started");71 Logging.Instance.Info(this.ToString(), "Hive Client started"); 72 72 ClientConsoleServer server = new ClientConsoleServer(); 73 73 server.StartClientConsoleServer(new Uri("net.tcp://127.0.0.1:8000/ClientConsole/")); … … 102 102 MessageContainer container = queue.GetMessage(); 103 103 Debug.WriteLine("Main loop received this message: " + container.Message.ToString()); 104 Logging. GetInstance().Info(this.ToString(), container.Message.ToString());104 Logging.Instance.Info(this.ToString(), container.Message.ToString()); 105 105 DetermineAction(container); 106 106 } … … 175 175 } 176 176 catch (InvalidStateException ise) { 177 Logging. GetInstance().Error(this.ToString(), "Exception: ", ise);177 Logging.Instance.Error(this.ToString(), "Exception: ", ise); 178 178 } 179 179 } … … 197 197 void wcfService_LoginCompleted(object sender, LoginCompletedEventArgs e) { 198 198 if (e.Result.Success) { 199 Logging. GetInstance().Info(this.ToString(), "Login completed to Hive Server @ " + DateTime.Now);199 Logging.Instance.Info(this.ToString(), "Login completed to Hive Server @ " + DateTime.Now); 200 200 } else 201 Logging. GetInstance().Error(this.ToString(), e.Result.StatusMessage);201 Logging.Instance.Error(this.ToString(), e.Result.StatusMessage); 202 202 } 203 203 … … 236 236 //better expand the sendjobresultcompltedeventargs with a boolean "snapshot?" flag 237 237 if (e.Result.finished == false) { 238 Logging. GetInstance().Info(this.ToString(), "Snapshot for Job " + e.Result.JobId + " transmitted");238 Logging.Instance.Info(this.ToString(), "Snapshot for Job " + e.Result.JobId + " transmitted"); 239 239 } else { 240 240 AppDomain.Unload(appDomains[e.Result.JobId]); … … 246 246 } 247 247 } 248 } else { 249 //Todo: don't Java Style! IT'S EVIL! 250 Logging.GetInstance().Error(this.ToString(), "Sending of job " + e.Result.JobId + " failed"); 248 } else { 249 Logging.Instance.Error(this.ToString(), "Sending of job " + e.Result.JobId + " failed"); 251 250 } 252 251 } … … 254 253 //Todo: First stop all threads, then terminate 255 254 void wcfService_ServerChanged(object sender, EventArgs e) { 256 Logging. GetInstance().Info(this.ToString(), "ServerChanged has been called");255 Logging.Instance.Info(this.ToString(), "ServerChanged has been called"); 257 256 lock (Locker) { 258 257 foreach (KeyValuePair<long, AppDomain> entries in appDomains) … … 270 269 //this is a little bit tricky - 271 270 void wcfService_ConnectionRestored(object sender, EventArgs e) { 272 Logging. GetInstance().Info(this.ToString(), "Reconnected to old server - checking currently running appdomains");271 Logging.Instance.Info(this.ToString(), "Reconnected to old server - checking currently running appdomains"); 273 272 274 273 foreach (KeyValuePair<long, Executor> execKVP in engines) { 275 274 if (!execKVP.Value.Running && execKVP.Value.CurrentMessage == MessageContainer.MessageType.NoMessage) { 276 Logging. GetInstance().Info(this.ToString(), "Checking for JobId: " + execKVP.Value.JobId);275 Logging.Instance.Info(this.ToString(), "Checking for JobId: " + execKVP.Value.JobId); 277 276 Thread finThread = new Thread(new ParameterizedThreadStart(GetFinishedJob)); 278 277 finThread.Start(execKVP.Value.JobId); … … 288 287 289 288 void appDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e) { 290 Logging. GetInstance().Error(this.ToString(), " Exception: " + e.ExceptionObject.ToString());289 Logging.Instance.Error(this.ToString(), " Exception: " + e.ExceptionObject.ToString()); 291 290 } 292 291 } -
trunk/sources/HeuristicLab.Hive.Client.Core/JobStorage/JobStorageManager.cs
r1364 r1371 28 28 storedJobsList.Add(info); 29 29 jobstream.Close(); 30 Logging. GetInstance().Info("JobStorrageManager", "Job " + info.JobID + " stored on the harddisc");30 Logging.Instance.Info("JobStorageManager", "Job " + info.JobID + " stored on the harddisc"); 31 31 } 32 32 catch (Exception e) { 33 //Todo: Change to logging.exception! 34 Console.WriteLine(e); 33 Logging.Instance.Error("JobStorageManager", "Exception: ", e); 35 34 } 36 35 } … … 40 39 if (WcfService.Instance.ConnState == NetworkEnum.WcfConnState.Loggedin && (storedJobsList[index-1].ServerIP == WcfService.Instance.ServerIP && storedJobsList[index-1].ServerPort == WcfService.Instance.ServerPort)) { 41 40 String filename = storedJobsList[index-1].ServerIP + "." + storedJobsList[index-1].ServerPort + "." + storedJobsList[index-1].JobID.ToString(); 42 Logging. GetInstance().Info("JobStorrageManager", "Sending stored job " + storedJobsList[index-1].JobID + " to the server");41 Logging.Instance.Info("JobStorrageManager", "Sending stored job " + storedJobsList[index - 1].JobID + " to the server"); 43 42 byte[] job = File.ReadAllBytes(path + filename + ".dat"); 44 43 … … 47 46 //TODO: has to be fixed from server side 48 47 //if (res.Success == true) { 49 Logging. GetInstance().Info("JobStorrageManager", "Sending of job " + storedJobsList[index - 1].JobID + " done");48 Logging.Instance.Info("JobStorrageManager", "Sending of job " + storedJobsList[index - 1].JobID + " done"); 50 49 storedJobsList.Remove(storedJobsList[index - 1]); 51 50 File.Delete(path + filename + ".dat");
Note: See TracChangeset
for help on using the changeset viewer.