private LogWarningChannel ( UnityEngine context, string channel, string message ) : void | ||
context | UnityEngine | |
channel | string | |
message | string | |
리턴 | void |
public static CardDefine[] getCardDefines(Assembly[] assemblies, ILogger logger) { List <CardDefine> cardList = new List <CardDefine>(); foreach (Assembly assembly in assemblies) { foreach (Type type in assembly.GetTypes().Where(t => t.IsSubclassOf(typeof(CardDefine)) && !t.IsAbstract && t != typeof(GeneratedCardDefine))) { ConstructorInfo constructor = type.GetConstructor(new Type[0]); if (constructor != null) { if (constructor.Invoke(new object[0]) is CardDefine define) { try { if (logger == null) { UberDebug.LogDebugChannel("Load", "加载内置卡片" + define.ToJson()); } else { logger.log("Load", "加载内置卡片" + define.ToJson()); } cardList.Add(define); } catch (Exception e) { if (e.InnerException is NotImplementedException) { if (logger == null) { UberDebug.LogWarningChannel("Load", "忽略尚未完成的卡片" + define); } else { logger.log("Load", "忽略尚未完成的卡片" + define); } } else { throw e; } } } } } } return(cardList.ToArray()); }
/// <summary> /// 设置动画 /// </summary> /// <param name="eventType"></param> /// <param name="animType"></param> public void setAnim(Type eventType, Type animType) { foreach (ConstructorInfo constructor in animType.GetConstructors()) { var args = constructor.GetParameters(); if (args.Length < 1 || (args.Length == 1 && args[0].ParameterType == eventType)) { if (animConstructorDic.ContainsKey(eventType)) { UberDebug.LogWarningChannel("UI", "存在冲突的动画" + animType); break; } animConstructorDic.Add(eventType, constructor); break; } } }
public void logWarn(string channel, string msg) { if (!enable) { return; } if (blackList.Contains(channel)) { return; } if (string.IsNullOrEmpty(channel)) { UberDebug.LogWarning((string.IsNullOrEmpty(name) ? null : (name + ":")) + msg); } else { UberDebug.LogWarningChannel(channel, (string.IsNullOrEmpty(name) ? null : (name + ":")) + msg); } }
// Use this for initialization void Start() { Debug.Log("Standard log operation"); UberDebug.LogChannel(LogChannels.TestChannel1, "Log message to TestChannel1"); UberDebug.LogChannel(LogChannels.TestChannel2, "Log message to TestChannel2"); UberDebug.LogChannel(LogChannels.TestChannel3, "Log message to TestChannel3"); UberDebug.LogChannel(LogChannels.TestChannel4, "Log message to TestChannel4"); UberDebug.LogChannel(LogChannels.TestChannel5, "Log message to TestChannel5"); UberDebug.LogWarningChannel(LogChannels.TestChannel1, "Log warning to TestChannel1"); UberDebug.LogWarningChannel(LogChannels.TestChannel2, "Log warning to TestChannel2"); UberDebug.LogWarningChannel(LogChannels.TestChannel3, "Log warning to TestChannel3"); UberDebug.LogWarningChannel(LogChannels.TestChannel4, "Log warning to TestChannel4"); UberDebug.LogWarningChannel(LogChannels.TestChannel5, "Log warning to TestChannel5"); UberDebug.LogErrorChannel(LogChannels.TestChannel1, "Log error to TestChannel1"); UberDebug.LogErrorChannel(LogChannels.TestChannel2, "Log error to TestChannel2"); UberDebug.LogErrorChannel(LogChannels.TestChannel3, "Log error to TestChannel3"); UberDebug.LogErrorChannel(LogChannels.TestChannel4, "Log error to TestChannel4"); UberDebug.LogErrorChannel(LogChannels.TestChannel5, "Log error to TestChannel5"); }
private void PostRequestFailed(UnityWebRequest request) { failuresSinceLastSuccessfulPost++; if (failuresSinceLastSuccessfulPost >= maxFailuresUntilShutDown) { ShutDown(); UberDebug.LogWarningChannel(StackdriverChannel, "Too many errors when talking to backend. UberLoggerStackdriver will shut down for the rest of the session."); postInProgress = false; } else { lock (stackdriverEntries) { if (retryCounter < maxRetries) { retryCounter++; // In-flight messages failed to get transmitted. Put them back at the beginning of the list stackdriverEntries.entries.InsertRange(0, stackdriverEntriesInFlight.entries); } stackdriverEntriesInFlight.entries.Clear(); } postInProgress = false; #if UNITY_2017_1_OR_NEWER bool requestNetworkError = request.isNetworkError; #else bool requestNetworkError = request.isError; #endif if (requestNetworkError) { UberDebug.LogWarningChannel(StackdriverChannel, "HTTP post to backend API failed. Unable to perform HTTP request. Error: " + request.error); // Unable to establish connection and perform HTTP request } else { UberDebug.LogWarningChannel(StackdriverChannel, "HTTP post to backend API failed. Backend API responded with an error. HTTP error code: " + request.responseCode + " Message: " + request.downloadHandler.text); // HTTP request performed, but backend responded with an HTTP error code } } }
public void DoTest() { // UnityEngine.Debug.Log("Starting"); Debug.LogWarning("Log Warning with GameObject", gameObject); Debug.LogError("Log Error with GameObject", gameObject); Debug.Log("Log Message with GameObject", gameObject); Debug.LogFormat("Log Format param {0}", "Test"); Debug.LogFormat(gameObject, "Log Format with GameObject and param {0}", "Test"); UberDebug.Log("ULog"); UberDebug.Log("ULog with param {0}", "Test"); UberDebug.Log(gameObject, "ULog with GameObject"); UberDebug.Log(gameObject, "ULog with GameObject and param {0}", "Test"); UberDebug.LogChannel("Test", "ULogChannel"); UberDebug.LogChannel("Test", "ULogChannel with param {0}", "Test"); UberDebug.LogChannel(gameObject, "Test", "ULogChannel with GameObject"); UberDebug.LogChannel(gameObject, "Test", "ULogChannel with GameObject and param {0}", "Test"); UberDebug.LogWarning("ULogWarning"); UberDebug.LogWarning("ULogWarning with param {0}", "Test"); UberDebug.LogWarning(gameObject, "ULogWarning with GameObject"); UberDebug.LogWarning(gameObject, "ULogWarning with GameObject and param {0}", "Test"); UberDebug.LogWarningChannel("Test", "ULogWarningChannel"); UberDebug.LogWarningChannel("Test", "ULogWarningChannel with param {0}", "Test"); UberDebug.LogWarningChannel(gameObject, "Test", "ULogWarningChannel with GameObject"); UberDebug.LogWarningChannel(gameObject, "Test", "ULogWarningChannel with GameObject and param {0}", "Test"); UberDebug.LogError("ULogError"); UberDebug.LogError("ULogError with param {0}", "Test"); UberDebug.LogError(gameObject, "ULogError with GameObject"); UberDebug.LogError(gameObject, "ULogError with GameObject and param {0}", "Test"); UberDebug.LogErrorChannel("Test", "ULogErrorChannel"); UberDebug.LogErrorChannel("Test", "ULogErrorChannel with param {0}", "Test"); UberDebug.LogErrorChannel(gameObject, "Test", "ULogErrorChannel with GameObject"); UberDebug.LogErrorChannel(gameObject, "Test", "ULogErrorChannel with GameObject and param {0}", "Test"); }
/// <summary> /// 游戏核心Request对应处理 /// </summary> /// <param name="obj"></param> private void onRequest(IRequest obj) { if (!obj.playersId.Contains(player.id)) { return; } UIAnimation anim; switch (obj) { default: anim = getRequestAnim(obj); break; } if (anim != null) { addAnim(anim); } else if (!(obj is FreeActRequest)) { UberDebug.LogWarningChannel("UI", "没有与" + obj + "相应的动画"); } }
/// <summary> /// 上面传下去的事件 /// </summary> /// <param name="args"></param> /// <param name="callback"></param> public void RecvAction(EventArgs args, GenericAction callback = null) { // 设置这个什么玩意来着……没错是随从 if (args is RetinueSummonEventArgs) { servantSummon(args as RetinueSummonEventArgs); } // 若传入事件是卡相关事件,则交予卡处理 if (args is ICardEventArgs) { var rid = (args as ICardEventArgs).CardRID; var card = GetCardByRID(rid); if (card != null) { card.RecvAction(args, callback); } else { UberDebug.LogWarningChannel("Frontend", $"没用找到对应RID为{rid}的卡片。当前卡片列表:{getCardsString()}"); callback?.Invoke(this, null); } } }
public static void logWarningChannel(string channel, string message, params object[] par) { UberDebug.LogWarningChannel(channel, preprocessMessage(message), par); }
public static void LogWarningChannel(UnityEngine.Object context, string channel, string message, params object[] par) { UberDebug.LogWarningChannel(context, channel, preprocessMessage(message), par); }
public static void Warning(string message, UnityEngine.Object context = null) { UberDebug.LogWarningChannel("Frontend", message, context); }
public static void LogNoImpl(string message, UnityEngine.Object context = null) { UberDebug.LogWarningChannel("Frontend", $"[NoImpl]{message}", context); }
/// <summary> /// Witness错误处理器 /// </summary> /// <param name="witness"></param> /// <param name="error"></param> /// <param name="deck"></param> /// <param name="callback"></param> /// <returns></returns> protected virtual bool witnessFailHandler(EventWitness witness, ErrorCode error, DeckController deck, GenericAction callback = null) { UberDebug.LogWarningChannel("View", "Witness遇到了错误:\n {0} {1}", witness, error); return(false); }