예제 #1
0
        public void LogWrite(string Message, Log.LogType LogType)
        {
            GeneralSettings generalSettings = GeneralSettings.CreateGeneralSettingsObject();

            if (Convert.ToBoolean(generalSettings.GetAppKey("OpenLog")))
            {
                string logPath = generalSettings.GetAppKey("LogPath");
                this.log.LogWrite(Message, LogType, logPath);
            }
        }
예제 #2
0
 public LogEntery(object text, string from, string action, Log.LogType logType, bool showExternal)
 {
     this.text = ParseText(text, showExternal);
     this.from = from;
     this.action = action;
     this.logType = logType;
     this.dateTime = DateTime.Now;
     this.showExternal = showExternal;
     // Provjerava dali se tko prijavio na event, event vraca broj zapisa za odredeni LogType
 }
예제 #3
0
        //void Application_ThreadException(object sender, ThreadExceptionEventArgs e)
        //{
        //    Log.Write(e.Exception, this, "Application_ThreadException", Log.LogType.ERROR);
        //}

        //void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
        //{
        //    Log.Write(e.ExceptionObject, this, "CurrentDomain_UnhandledException", Log.LogType.ERROR);
        //}

        void Log_OnLogTypeNumberChange(Log.LogType logType, int number)
        {
            // Uzimamo samo broj ERROR-a
            if (logType == Log.LogType.ERROR)
            {
                tssErrors.Text = "Errors: " + number.ToString();
            }
            else if (logType == Log.LogType.WARNING)
            {
                tssWarnings.Text = "Warnings: " + number.ToString();
            }
        }
        public async Task LogAsync(Log.LogType type, string content)
        {
            var log = new Log
            {
                Type        = type,
                Content     = content,
                LastUpdated = DateTime.Now
            };
            await _logRepository.AddAsync(log);

            await _hubContext.Clients.Group(log.Type.ToString()).SendAsync("ReceiveLog",
                                                                           log.LastUpdated.ToString(),
                                                                           log.Type.ToString(),
                                                                           log.Content);

            await _hubContext.Clients.Group("All").SendAsync("ReceiveLog",
                                                             log.LastUpdated.ToString(),
                                                             log.Type.ToString(),
                                                             log.Content);
        }
예제 #5
0
        private void SearchEngineFinish(Task <int> previousTask, string engineName, Log.ModuleType module)
        {
            string logMessage = String.Empty;

            Log.LogType logType = Log.LogType.medium;
            if (previousTask.IsCanceled)
            {
                logMessage = $"{engineName} search aborted!!";
            }
            else if (previousTask.IsFaulted)
            {
                logMessage = $"An error has ocurred on {engineName}: {String.Join(Environment.NewLine, (previousTask.Exception)?.InnerException.Message)}.";
                logType    = Log.LogType.error;
            }
            else if (previousTask.IsCompleted)
            {
                logMessage = $"{engineName} search finished successfully!!";
            }

            Program.LogThis(new Log(module, logMessage, logType));
        }
예제 #6
0
		public override void Reset () {
			variable = new Variable();
			logType = Log.LogType.Log;
		}
예제 #7
0
 private void Net2_instance_delegateNewLog(string log_message, Log.LogType log_type, string section)
 {
     delegateNewLog?.Invoke(log_message, log_type, section);
 }
예제 #8
0
 public override void Reset()
 {
     variable = new Variable();
     logType  = Log.LogType.Log;
 }
예제 #9
0
 public LogStream(Log.LogType type, string file, uint line, string func) : this(yarpPINVOKE.new_LogStream__SWIG_0((int)type, file, line, func), true)
 {
 }
예제 #10
0
 public static void updateLog(Log.LogType logType, string log)
 {
     Log.updateLog(logType, log);
 }