public void RemoveCrashFilter(GamebaseCallback.Logger.CrashFilter filter)
        {
            GamebaseLog.Debug("RemoveCrashFilter", this);
            ToastLogger.CrashFilter crashFilter = crashFilterDictionary[filter];

            ToastLogger.RemoveCrashFilter(crashFilter);

            crashFilterDictionary.Remove(filter);
        }
Beispiel #2
0
        public void Update()
        {
            ToastLogger.ScrollToBottom();

            if (IsMainThread && MainThreadTasks.Count > 0)
            {
                MainThreadTasks.Dequeue()();
            }
        }
 public void SetCrashListener(GamebaseCallback.Logger.CrashListener listener)
 {
     GamebaseLog.Debug("SetCrashListener", this);
     ToastLogger.SetCrashListener(
         (isSuccess, logEntry) =>
     {
         GamebaseLog.Debug("OnCrashListener", this);
         listener(isSuccess, ConvertGamebaseLogEntry(logEntry));
     });
 }
        public void AddCrashFilter(GamebaseCallback.Logger.CrashFilter filter)
        {
            GamebaseLog.Debug("AddCrashFilter", this);
            ToastLogger.CrashFilter crashFilter =
                (logData) =>
            {
                GamebaseLog.Debug("OnCrashFilter", this);
                GamebaseResponse.Logger.CrashLogData crashLogData = new GamebaseResponse.Logger.CrashLogData();
                crashLogData.logType    = (GamebaseLoggerConst.LogType)logData.LogType;
                crashLogData.condition  = logData.Condition;
                crashLogData.stackTrace = logData.StackTrace;

                return(filter(crashLogData));
            };

            ToastLogger.AddCrashFilter(crashFilter);

            crashFilterDictionary.Add(filter, crashFilter);
        }
        public void Initialize(GamebaseRequest.Logger.Configuration loggerConfiguration)
        {
            GamebaseLog.Debug("Initialize", this);

            ToastLoggerConfiguration configuration = new ToastLoggerConfiguration();

            configuration.AppKey = loggerConfiguration.appKey;
            configuration.EnableCrashErrorLog = loggerConfiguration.enableCrashErrorLog;
            configuration.EnableCrashReporter = loggerConfiguration.enableCrashReporter;

            switch (loggerConfiguration.serviceZone.ToLower())
            {
            case "alpha":
            {
                configuration.ServiceZone = ToastServiceZone.ALPHA;
                break;
            }

            case "beta":
            {
                configuration.ServiceZone = ToastServiceZone.BETA;
                break;
            }

            case "real":
            default:
            {
                configuration.ServiceZone = ToastServiceZone.REAL;
                break;
            }
            }

            GamebaseLog.Debug(GamebaseJsonUtil.ToPrettyJsonString(configuration), typeof(UnityLoggerControlle));

            ToastLogger.Initialize(configuration);
        }
 public void SetLoggerListener(GamebaseCallback.Logger.ILoggerListener listener)
 {
     GamebaseLog.Debug("SetLoggerListener", this);
     ToastLogger.SetLoggerListener(new GamebaseLoggerListener(listener));
 }
 public void SetUserField(string key, string value)
 {
     GamebaseLog.Debug("SetUserField", this);
     ToastLogger.SetUserField(key, value);
 }
 public void Fatal(string message, Dictionary <string, string> userFields = null)
 {
     GamebaseLog.Debug("Fatal", this);
     ToastLogger.Fatal(message, userFields);
 }
 public void Error(string message, Dictionary <string, string> userFields = null)
 {
     GamebaseLog.Debug("Error", this);
     ToastLogger.Error(message, userFields);
 }
 public void Warn(string message, Dictionary <string, string> userFields = null)
 {
     GamebaseLog.Debug("Warn", this);
     ToastLogger.Warn(message, userFields);
 }
 public void Info(string message, Dictionary <string, string> userFields = null)
 {
     GamebaseLog.Debug("Info", this);
     ToastLogger.Info(message, userFields);
 }