using ProtoCSStruct; using Sog; using Sog.Log; using System; using System.Collections.Generic; namespace Account { public class AccountTALogUtils { private static readonly string Android = "ANDROID"; private static readonly string IOS = "IOS"; private static readonly string PC = "PC"; private static string GetBdcOs(PlatformType platform) { switch (platform) { case PlatformType.PlatformType_Android: return Android; case PlatformType.PlatformType_IOS: return IOS; case PlatformType.PlatformType_Windows: return PC; default: return PC; } } private static void InitPublicProperties(AccountInfoOnAccountServer accountInfo, TALogHelper ta) { ta.Add("channel", accountInfo.ChannelId.ToString()); ta.Add("#device_id", accountInfo.DeviceID); ta.Add("account_id", accountInfo.AccountID); ta.Add("platform", GetBdcOs((PlatformType) accountInfo.PlatformType)); } public static void LogAccountRegister(AccountInfoOnAccountServer accountInfo) { var ta = new TALogHelper(TALOG_TYPE.TRACE, null, accountInfo.TaDistinctID, TALogEventName.Account_Register); InitPublicProperties(accountInfo, ta); ta.PutLog(); } public static void LogAccountLogin(AccountInfoOnAccountServer accountInfo) { var ta = new TALogHelper(TALOG_TYPE.TRACE, null, accountInfo.TaDistinctID, TALogEventName.Account_login); InitPublicProperties(accountInfo, ta); ta.PutLog(); } } }