Esempio n. 1
0
		static void NotifyError (LogMessage message)
		{
			if (!errorNotificationEnabled)
				return;
			ClearErrorIcon ();
			var pix = ImageService.GetIcon (Gtk.Stock.DialogError, Gtk.IconSize.Menu);
			errorIcon = IdeApp.Workbench.StatusBar.ShowStatusIcon (pix);
			errorIcon.Clicked += delegate {
				ClearErrorIcon ();
				MessageService.ShowError (message.Message);
			};
			errorIcon.SetAlertMode (5);
			errorIcon.ToolTip = message.Message;
		}
		static void NotifyError (LogMessage message)
		{
			if (!errorNotificationEnabled)
				return;
			ClearErrorIcon ();
			Gdk.Pixbuf pix = ImageService.GetPixbuf (Gtk.Stock.DialogError, Gtk.IconSize.Menu);
			errorIcon = IdeApp.Workbench.StatusBar.ShowStatusIcon (pix);
			errorIcon.EventBox.ButtonPressEvent += delegate {
				ClearErrorIcon ();
				MessageService.ShowError (message.Message);
			};
			errorIcon.SetAlertMode (5);
			errorIcon.ToolTip = message.Message;
		}
Esempio n. 3
0
			public void Log (LogLevel level, string message)
			{
				LogMessage logMessage = new LogMessage (level, message);

				if (level  == LogLevel.Fatal) {
					if (errorNotificationEnabled) {
						Gtk.Application.Invoke (delegate {
							InternalLog.NotifyError (logMessage);
						});
					}
					else
						LastError = logMessage;
				}
			}
Esempio n. 4
0
			public void Log (LogLevel level, string message)
			{
				LogMessage logMessage = new LogMessage (level, message);
				lock (Messages) {
					Messages.Add (logMessage);
					switch (level) {
						case LogLevel.Fatal: ErrorCount++; break;
						case LogLevel.Error: ErrorCount++; break;
						case LogLevel.Warn:  WarningCount++; break;
						case LogLevel.Info:  InfoCount++; break;
						case LogLevel.Debug: DebugCount++; break;
					}
				}
				
				if (level  == LogLevel.Fatal) {
					if (errorNotificationEnabled) {
						Gtk.Application.Invoke (delegate {
							InternalLog.NotifyError (logMessage);
						});
					}
					else
						LastError = logMessage;
				}
			}
		void ILogger.Log (LogLevel level, string message)
		{
			if (window != null && window.Visible) {
				LogMessage msg = new LogMessage (level, message);
				Gtk.Application.Invoke (delegate {
					AddMessage (msg);
				});
			} else {
				needsReload = true;
			}
		}
		public void AddMessage (LogMessage message)
		{
			Gdk.Pixbuf stock;
			
			switch (message.Level) {
				case LogLevel.Fatal:
				case LogLevel.Error:
					stock = iconError;
					UpdateErrorsNum ();
					break; 
				case LogLevel.Warn:
					stock = iconWarning;
					UpdateWarningsNum ();	
					break;
				case LogLevel.Info:
					stock = iconInfo;
					UpdateWarningsNum ();	
					break;
				case LogLevel.Debug:
					stock = iconDebug;
					UpdateDebugNum ();
					break;
				default:
					stock = iconDebug;
					break;
			}

			store.AppendValues (stock,
			                    message.Message,
			                    message.TimeStamp.ToLongTimeString (),
			                    message.Level.ToString (),
			                    message);
			filter.Refilter ();
		}