Пример #1
0
 public void Append(string m, ROSOUT_LEVEL lvl, int level = 1)
 {
     StackFrame sf = new StackTrace(new StackFrame(level, true)).GetFrame(0);
     Log l = new Log {msg = new m.String(m), level = ((byte) ((int) lvl)), name = new m.String(this_node.Name), file = new m.String(sf.GetFileName()), function = new m.String(sf.GetMethod().Name), line = (uint) sf.GetFileLineNumber()};
     string[] advert = this_node.AdvertisedTopics().ToArray();
     l.topics = new m.String[advert.Length];
     for (int i = 0; i < advert.Length; i++)
         l.topics[i] = new m.String(advert[i]);
     lock (queue_mutex)
         log_queue.Enqueue(l);
 }
        public override bool Init(Main Main, System.Diagnostics.Stopwatch swInit)
        {
            if (!Main.EventMgr.PluginExists<Events.Processes>())
            {
                this.Log.LogLine("Task \"LogProcessStartedEvents\" is missing EventPlugin \"ProcessStarted\"!", Log.Type.Error);
                return false;
            }

            this.Main = Main;
            this.Log = Main.Log;

            swInit.Stop();
            Events.Processes procEvents = Main.EventMgr.GetPlugin<Events.Processes>();
            swInit.Start();

            procEvents.ProcessCreated += new Events.EventPlugin.EventValue<Process>(procEvents_ProcessCreated);
            procEvents.ProcessExited += new EventPlugin.EventValue<Process>(procEvents_ProcessExited);
            return true;
        }
Пример #3
0
 protected HttpServer(Log log, ushort port, byte address1, byte address2, byte address3, byte address4)
 {
     Log = log;
     _listener = new TcpServer(port, address1, address2, address3, address4);
 }
Пример #4
0
 public ConsoleLog(Log.Level level)
 {
     CurrentLevel = level;
 }