Exemplo n.º 1
0
 static TestBase()
 {
     LoggingService.AddLogger(
         new MonoDevelop.Core.Logging.FileLogger(
             Path.Combine(Util.TestsRootDir, "TestResult_LoggingService.log")
             )
         );
 }
Exemplo n.º 2
0
 public static void Initialize()
 {
     if (!Initialized)
     {
         logger = new InternalLogger();
         LoggingService.AddLogger(logger);
     }
 }
Exemplo n.º 3
0
        void SetupTestLogger()
        {
            reproStepIndex = 0;
            var currentTestLog = Path.Combine(currentTestResultFolder, string.Format("{0}.Test.log.txt", TestContext.CurrentContext.Test.Name.ToPathSafeString()));

            Logger = new FileLogger(currentTestLog)
            {
                Name         = TestContext.CurrentContext.Test.Name,
                EnabledLevel = EnabledLoggingLevel.All,
            };
            LoggingService.AddLogger(Logger);
        }
Exemplo n.º 4
0
        public MeshworkDaemon(string fileName)
        {
            LogItem("MESHWORK DAEMON CLIENT 0.1");

            // FIXME FileFind.Utils.SetProcessName("meshwork-daemon");
            // Stdlib.signal(Signum.SIGINT, handle_signal);
            // Stdlib.signal(Signum.SIGKILL, handle_signal);

            settings = Settings.ReadSettings(fileName);

            core = new Core(settings, getPlatform());
            core.AvatarManager = new AvatarManager(core);

            core.NetworkAdded += AddNetworkEvents;
            LoggingService.AddLogger(this);

            core.Start();
        }
Exemplo n.º 5
0
        public void CriticalErrorsExceptionsHaveFullStacktracesInLog()
        {
            var logger = new CapturingLogger {
                EnabledLevel = EnabledLoggingLevel.Fatal,
            };

            try {
                LoggingService.AddLogger(logger);

                var ex       = new NSException("Test", "should be captured", null);
                var selector = ObjCRuntime.Selector.GetHandle("raise");

                Assert.Throws <ObjCException> (() => void_objc_msgSend(ex.Handle, selector));

                var(_, message) = logger.LogMessages.Single(x => x.Level == LogLevel.Fatal);
                AssertMacPlatformStacktrace(message);
            } finally {
                LoggingService.RemoveLogger(logger.Name);
            }
        }
Exemplo n.º 6
0
        private StatusLogPage()
        {
            m_TextView          = new TextView();
            m_TextView.Editable = false;

            ScrolledWindow swindow = new ScrolledWindow();

            swindow.Add(m_TextView);

            this.PackStart(swindow, true, true, 0);
            swindow.ShowAll();

            var tag = new TextTag("Error");

            tag.Foreground = "darkred";
            m_TextView.Buffer.TagTable.Add(tag);

            tag            = new TextTag("Fatal");
            tag.Foreground = "darkred";
            m_TextView.Buffer.TagTable.Add(tag);

            tag            = new TextTag("Warn");
            tag.Foreground = "darkorange";
            m_TextView.Buffer.TagTable.Add(tag);

            tag            = new TextTag("Info");
            tag.Foreground = "darkgreen";
            m_TextView.Buffer.TagTable.Add(tag);

            tag            = new TextTag("Debug");
            tag.Foreground = "darkblue";
            m_TextView.Buffer.TagTable.Add(tag);

            m_TextView.Buffer.CreateMark("end", m_TextView.Buffer.EndIter, false);

            LoggingService.AddLogger(this);
        }
Exemplo n.º 7
0
        static TestBase()
        {
            var topPath = LocateTopLevel();

            LoggingService.AddLogger(new MonoDevelop.Core.Logging.FileLogger(Path.Combine(topPath, "TestResult_LoggingService.log")));
        }
Exemplo n.º 8
0
    public static int Main(string[] args)
    {
        string     tmpFile = null;
        TextReader input   = null;

        try {
            // The first parameter is the task id
            // The second parameter is the temp file that contains the data
            // If not provided, data is read from the standard input

            if (args.Length > 1)
            {
                tmpFile = args [1];
                input   = new StreamReader(tmpFile);
            }
            else
            {
                input = Console.In;
            }

            string sref       = input.ReadLine();
            string pidToWatch = input.ReadLine();

            if (tmpFile != null)
            {
                try {
                    input.Close();
                    File.Delete(tmpFile);
                } catch {
                }
            }

            WatchParentProcess(int.Parse(pidToWatch));

            string unixPath = RegisterRemotingChannel();

            byte[]                 data = Convert.FromBase64String(sref);
            MemoryStream           ms   = new MemoryStream(data);
            BinaryFormatter        bf   = new BinaryFormatter();
            IProcessHostController pc   = (IProcessHostController)bf.Deserialize(ms);

            LoggingService.AddLogger(new LocalLogger(pc.GetLogger(), args[0]));

            ProcessHost rp = new ProcessHost(pc);
            pc.RegisterHost(rp);
            try {
                pc.WaitForExit();
            } catch {
            }

            try {
                rp.Dispose();
            } catch {
            }

            if (unixPath != null)
            {
                File.Delete(unixPath);
            }
        } catch (Exception ex) {
            Console.WriteLine(ex);
        }

        return(0);
    }
 protected override void Run()
 {
     LoggingService.AddLogger(new LogMonitorLogger());
     CurrentIdeLogFile.Update();
 }
Exemplo n.º 10
0
 protected override void Run()
 {
     LoggingService.AddLogger(new LogMonitorLogger());
 }
Exemplo n.º 11
0
        public void Initialize(IPadWindow window)
        {
            this.window      = window;
            window.PadShown += delegate {
                if (needsReload)
                {
                    Refresh();
                }
            };

            DockItemToolbar toolbar = window.GetToolbar(PositionType.Top);

            errorBtn        = new ToggleButton();
            errorBtn.Active = (bool)PropertyService.Get(showErrorsPropertyName, true);
            string errorTipText;

            if ((InternalLog.EnabledLoggingLevel & EnabledLoggingLevel.Error) != EnabledLoggingLevel.Error &&
                (InternalLog.EnabledLoggingLevel & EnabledLoggingLevel.Fatal) != EnabledLoggingLevel.Fatal)
            {
                errorBtn.Sensitive = false;
                errorTipText       = GettextCatalog.GetString("Logging of errors is not enabled");
            }
            else
            {
                errorTipText = GettextCatalog.GetString("Show errors");
            }
            errorBtn.Image = new Gtk.Image(Gtk.Stock.DialogError, Gtk.IconSize.Menu);
            errorBtn.Image.Show();
            errorBtn.Toggled    += new EventHandler(FilterChanged);
            errorBtn.TooltipText = errorTipText;
            UpdateErrorsNum();
            toolbar.Add(errorBtn);

            warnBtn        = new ToggleButton();
            warnBtn.Active = (bool)PropertyService.Get(showWarningsPropertyName, true);
            string warnTipText;

            if ((InternalLog.EnabledLoggingLevel & EnabledLoggingLevel.Warn) != EnabledLoggingLevel.Warn)
            {
                warnBtn.Sensitive = false;
                warnTipText       = GettextCatalog.GetString("Logging of warnings is not enabled");
            }
            else
            {
                warnTipText = GettextCatalog.GetString("Show warnings");
            }
            warnBtn.Image = new Gtk.Image(Gtk.Stock.DialogWarning, Gtk.IconSize.Menu);
            warnBtn.Image.Show();
            warnBtn.Toggled    += new EventHandler(FilterChanged);
            warnBtn.TooltipText = warnTipText;
            UpdateWarningsNum();
            toolbar.Add(warnBtn);

            msgBtn        = new ToggleButton();
            msgBtn.Active = (bool)PropertyService.Get(showMessagesPropertyName, true);
            string msgTipText;

            if ((InternalLog.EnabledLoggingLevel & EnabledLoggingLevel.Info) != EnabledLoggingLevel.Info)
            {
                msgBtn.Sensitive = false;
                msgTipText       = GettextCatalog.GetString("Logging of informational messages is not enabled");
            }
            else
            {
                msgTipText = GettextCatalog.GetString("Show messages");
            }
            msgBtn.Image = new Gtk.Image(Gtk.Stock.DialogInfo, Gtk.IconSize.Menu);
            msgBtn.Image.Show();
            msgBtn.Toggled    += new EventHandler(FilterChanged);
            msgBtn.TooltipText = msgTipText;
            UpdateMessagesNum();
            toolbar.Add(msgBtn);

            debugBtn        = new ToggleButton();
            debugBtn.Active = (bool)PropertyService.Get(showDebugPropertyName, true);
            string debugTipText;

            if ((InternalLog.EnabledLoggingLevel & EnabledLoggingLevel.Debug) != EnabledLoggingLevel.Debug)
            {
                debugBtn.Sensitive = false;
                debugTipText       = GettextCatalog.GetString("Logging of debug messages is not enabled");
            }
            else
            {
                debugTipText = GettextCatalog.GetString("Show debug");
            }
            debugBtn.Image = new Gtk.Image(Gtk.Stock.DialogQuestion, Gtk.IconSize.Menu);
            debugBtn.Image.Show();
            debugBtn.Toggled    += new EventHandler(FilterChanged);
            debugBtn.TooltipText = debugTipText;
            UpdateDebugNum();
            toolbar.Add(debugBtn);

            toolbar.Add(new SeparatorToolItem());

            Gtk.Button clearBtn = new Gtk.Button(new Gtk.Image(Gtk.Stock.Clear, Gtk.IconSize.Menu));
            clearBtn.Clicked += new EventHandler(OnClearList);
            toolbar.Add(clearBtn);
            toolbar.ShowAll();

            // Content

            store = new Gtk.ListStore(typeof(Gdk.Pixbuf),                    // image - type
                                      typeof(string),                        // desc
                                      typeof(string),                        // time
                                      typeof(string),                        // type string
                                      typeof(LogMessage));                   // message

            TreeModelFilterVisibleFunc filterFunct = new TreeModelFilterVisibleFunc(FilterTaskTypes);

            filter             = new TreeModelFilter(store, null);
            filter.VisibleFunc = filterFunct;

            view                  = new MonoDevelop.Ide.Gui.Components.PadTreeView(new Gtk.TreeModelSort(filter));
            view.RulesHint        = true;
            view.HeadersClickable = true;
            view.Selection.Mode   = SelectionMode.Multiple;

            view.DoPopupMenu = (evt) =>
                               IdeApp.CommandService.ShowContextMenu(view, evt, new CommandEntrySet()
            {
                new CommandEntry(EditCommands.Copy),
                new CommandEntry(EditCommands.SelectAll),
            });

            AddColumns();

            sw            = new Gtk.ScrolledWindow();
            sw.ShadowType = ShadowType.None;
            sw.Add(view);

            LoggingService.AddLogger(this);

            iconWarning = sw.RenderIcon(Gtk.Stock.DialogWarning, Gtk.IconSize.Menu, "");
            iconError   = sw.RenderIcon(Gtk.Stock.DialogError, Gtk.IconSize.Menu, "");
            iconInfo    = sw.RenderIcon(Gtk.Stock.DialogInfo, Gtk.IconSize.Menu, "");
            iconDebug   = sw.RenderIcon(Gtk.Stock.DialogQuestion, Gtk.IconSize.Menu, "");

            control = sw;
            sw.ShowAll();

            Refresh();

            store.SetSortFunc((int)Columns.Time, TimeSortFunc);
            ((TreeModelSort)view.Model).SetSortColumnId((int)Columns.Time, SortType.Descending);
        }