示例#1
0
        public async void LogError(string userFriendlyMessage, string message, Exception ex = null)
        {
            if (!LoggingService._isEnabled)
            {
                return;
            }


            var newMsg = new LogMessage()
            {
                FriendlyMessage = userFriendlyMessage,
                Message = message,
                Exception = null,
                Type = 3
            };

            WriteMsg(newMsg);
        }
示例#2
0
        public static async void LogInformation(string userFriendlyMessage, string message)
        {
            if (!LoggingService._isEnabled)
            {
                return;
            }

            var newMsg = new LogMessage()
                {
                    FriendlyMessage = userFriendlyMessage,
                    Message = message,
                    Exception = null,
                    Type = 1
                };

            WriteMsg(newMsg);
        }
示例#3
0
        private static async void WriteMsg(LogMessage newMsg)
        {

            if (newMsg == null) return;

            await Task.Run(() => {

                newMsg.DateStamp = DateTime.UtcNow;

                if (_isSavingToDb)
                {
                    _shadowLoggingMessages.Add(newMsg);
                }
                else
                {
                    LoggingMessages.Add(newMsg);
                }

                Messenger.Default.Send<GeneralSystemWideMessage>(new GeneralSystemWideMessage("writing ...") { Identifier = "LB", SourceId = "WriteMsg" });

            });


        }