コード例 #1
0
ファイル: Log.cs プロジェクト: mkopadev/salesapp
        public void Warning(Exception e, [CallerMemberName] string memberName = "",
                            [CallerFilePath] string sourceFilePath            = "",
                            [CallerLineNumber] int sourceLineNumber           = 0)
        {
            if (!string.IsNullOrEmpty(e.Message))
            {
                AndroidLog.Warn(_target, e.Message);
            }

            if (!string.IsNullOrEmpty(e.StackTrace))
            {
                AndroidLog.Warn(_target, e.StackTrace);
            }

            CrashlyticsLog(e);
            Writer.Write(e);

            if (_xamarinInsights)
            {
                Dictionary <string, string> additionalInfo = new Dictionary <string, string>
                {
                    { "Member Name", memberName },
                    { "Source Filepath", sourceFilePath },
                    { "Source Line Number", sourceLineNumber.ToString() },
                    { "CallStack", _traceEventCache.Callstack }
                };

                Insights.Report(e, additionalInfo);
            }
        }
コード例 #2
0
ファイル: Log.cs プロジェクト: mkopadev/salesapp
        public void Warning(string w, [CallerMemberName] string memberName = "",
                            [CallerFilePath] string sourceFilePath         = "",
                            [CallerLineNumber] int sourceLineNumber        = 0)
        {
            if (w == null)
            {
                w = _defaultLogString;
            }

            AndroidLog.Warn(_target, w);
            CrashlyticsLog(w);

            if (FileExtensiveLogs)
            {
                Writer.Write(w);
            }

            if (_xamarinInsights)
            {
                Dictionary <string, string> additionalInfo = new Dictionary <string, string>
                {
                    { "Member Name", memberName },
                    { "Source Filepath", sourceFilePath },
                    { "Source Line Number", sourceLineNumber.ToString() },
                    { "CallStack", _traceEventCache.Callstack }
                };

                Insights.Report(new Exception(w), additionalInfo);
            }
        }
コード例 #3
0
 public static void w(string tag, string msg)
 {
     if (LOG_ENABLE)
     {
         Log.Warn(tag, msg);
     }
 }
コード例 #4
0
        protected override void Write(LogEventInfo logEvent)
        {
            var logMessage = this.Layout.Render(logEvent);

            if (logEvent.Level.Equals(LogLevel.Info))
            {
                Log.Info(logEvent.LoggerName, logMessage);
                return;
            }
            if (logEvent.Level.Equals(LogLevel.Debug))
            {
                Log.Debug(logEvent.LoggerName, logMessage);
                return;
            }
            if (logEvent.Level.Equals(LogLevel.Warn))
            {
                Log.Warn(logEvent.LoggerName, logMessage);
                return;
            }
            if (logEvent.Level.Equals(LogLevel.Error))
            {
                Log.Error(logEvent.LoggerName, logMessage);
                return;
            }
        }
コード例 #5
0
                public void Log(LogLevel level, string format, object param1, object param2)
                {
                    switch (level)
                    {
                    case LogLevel.Debug:
                        AndroidLog.Debug(_name, format, param1, param2);
                        break;

                    case LogLevel.Info:
                        AndroidLog.Info(_name, format, param1, param2);
                        break;

                    case LogLevel.Warn:
                        AndroidLog.Warn(_name, format, param1, param2);
                        break;

                    case LogLevel.Error:
                        AndroidLog.Error(_name, format, param1, param2);
                        break;
                    }
                }
コード例 #6
0
                public void Log(LogLevel level, object message)
                {
                    var s = message.ToString();

                    switch (level)
                    {
                    case LogLevel.Debug:
                        AndroidLog.Debug(_name, s);
                        break;

                    case LogLevel.Info:
                        AndroidLog.Info(_name, s);
                        break;

                    case LogLevel.Warn:
                        AndroidLog.Warn(_name, s);
                        break;

                    case LogLevel.Error:
                        AndroidLog.Error(_name, s);
                        break;
                    }
                }
コード例 #7
0
 protected override void Warning(ILog log, string message, object extraData, LogData logData, DateTime time)
 {
     Log.Warn(Tag, message);
 }
コード例 #8
0
 public void warn(string tag, string text)
 {
     ALog.Warn(tag, text);
 }