コード例 #1
0
 private static void SetCommonData(Dictionary <string, string> userFields)
 {
     if (string.IsNullOrEmpty(ToastSdk.UserId) == false)
     {
         userFields.Add(ToastAuditLoggerContants.AUDIT_USER_ID, ToastSdk.UserId);
     }
     userFields.Add(ToastAuditLoggerContants.AUDIT_APP_ID, ToastLoggerCommonLogic.AppKey);
     userFields.Add(ToastAuditLoggerContants.AUDIT_APP_NAME, Application.productName);
     userFields.Add(ToastAuditLoggerContants.AUDIT_APP_VERSION, Application.version);
     userFields.Add(ToastAuditLoggerContants.AUDIT_SDK_FUNCTION, ToastAuditLoggerContants.AUDIT_VALUE_SDK_FUNCTION);
     userFields.Add(ToastAuditLoggerContants.AUDIT_OS, ToastAuditLoggerContants.AUDIT_VALUE_OS);
     userFields.Add(ToastAuditLoggerContants.AUDIT_OS_VERSION, SystemInfo.operatingSystem);
     userFields.Add(ToastAuditLoggerContants.AUDIT_SESSION_ID, ToastApplicationInfo.GetSessionId());
     userFields.Add(ToastAuditLoggerContants.AUDIT_COUNTRY_CODE, ToastApplicationInfo.GetCountryCode());
 }
コード例 #2
0
        private static bool Initialize()
        {
            if (_logger == null)
            {
                string auditProejctKey = ToastApplicationInfo.GetAuditKey();

                if (string.IsNullOrEmpty(auditProejctKey))
                {
                    return(false);
                }

                _logger = new InstanceLogger(auditProejctKey);
            }

            return(true);
        }
コード例 #3
0
        private static void SetCommonData(ToastLoggerLogObject logObject, string loggerType)
        {
            logObject.Put(ToastLoggerFields.PROJECT_VERSION, Application.version);
            logObject.Put(ToastLoggerFields.DEVICE_ID, ToastDeviceInfo.GetDeviceUniqueIdentifier());
            logObject.Put(ToastLoggerFields.PLATFORM_NAME, ToastApplicationInfo.GetPlatformName());
            logObject.Put(ToastLoggerFields.LAUNCHED_ID, ToastApplicationInfo.GetLaunchedId());
            logObject.Put(ToastLoggerFields.SDK_VERSION, ToastApplicationInfo.GetSDKVersion());
            logObject.Put(ToastLoggerFields.SESSION_ID, ToastApplicationInfo.GetSessionId());

            foreach (var item in Fields)
            {
                logObject.SetUserField(item.Key, item.Value);
            }

            if (ToastLoggerType.SESSION == loggerType ||
                ToastLoggerType.CRASH == loggerType ||
                ToastLoggerType.HANDLED == loggerType ||
                ToastLoggerType.CRASH_FROM_INACTIVATED_STATE == loggerType ||
                ToastLoggerType.CRASH_FROM_UNITY == loggerType)
            {
                logObject.Put(ToastLoggerFields.DEVICE_MODEL, ToastApplicationInfo.GetDeviceModel());
                logObject.Put(ToastLoggerFields.COUNTRY_CODE, ToastApplicationInfo.GetCountryCode());
            }
        }