/*public virtual void OnNetworkReceive(NetPeer peer, NetDataReader reader) { * TinyLogger.Log("[" + TYPE + "] On network receive from: " + peer.EndPoint); * }*/ //============ INetLogger ========================// public void WriteNet(NetLogLevel level, string str, params object[] args) { switch (level) { case NetLogLevel.Warning: if (TinyNetLogLevel.logWarn) { TinyLogger.LogFormat(str, args); } break; case NetLogLevel.Error: if (TinyNetLogLevel.logError) { TinyLogger.LogFormat(str, args); } break; case NetLogLevel.Trace: if (TinyNetLogLevel.logDev) { TinyLogger.LogFormat(str, args); } break; case NetLogLevel.Info: if (TinyNetLogLevel.logInfo) { TinyLogger.LogFormat(str, args); } break; } }
public void WriteNet(NetLogLevel level, string str, params object[] args) { if (level == NetLogLevel.Error || level == NetLogLevel.Warning) { Assert.Fail(str, args); } }
void INetLogger.WriteNet(NetLogLevel level, string str, params object[] args) { var msg = args.Length == 0 ? str : string.Format(str, args); var current = DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss"); var output = $"[{current}] {msg}"; Console.WriteLine(output); }
private void WriteNet(NetLogLevel info, string str, params object[] args) { if (!_config.ServerLoggingConfig.Logging || !_config.ServerLoggingConfig.ServerLogging) { return; } NetDebug.Logger?.WriteNet(info, str, args); }
public void WriteNet(NetLogLevel level, string str, params object[] args) { if (level == NetLogLevel.Error) { Error(string.Format(str, args)); } else { Log(string.Format(str, args)); } }
private static void WriteLogic(NetLogLevel logLevel, string str, params object[] args) { lock (DebugLogLock) { if (Logger == null) { #if UNITY_4 || UNITY_5 || UNITY_5_3_OR_NEWER UnityEngine.Debug.Log(string.Format(str, args)); #else Console.WriteLine(str, args); #endif } else { Logger.WriteNet(logLevel, str, args); } } }
public void WriteNet(NetLogLevel level, string str, params object[] args) { switch (level) { case NetLogLevel.Warning: Console.WriteLine("Warning: " + str); break; case NetLogLevel.Error: Console.WriteLine("Error: " + str); break; case NetLogLevel.Trace: Console.WriteLine("Trace: " + str); break; case NetLogLevel.Info: Console.WriteLine("Info: " + str); break; default: break; } }
public void WriteNet(NetLogLevel level, string str, params object[] args) { Debug.LogFormat(str, args); }
internal static void WriteForce(NetLogLevel level, string str, params object[] args) { WriteLogic(level, str, args); }
public void WriteNet(NetLogLevel level, string str, params object[] args) { Console.WriteLine(str, args); }
public void WriteNet(NetLogLevel level, string str, params object[] args) { logger.InfoFormat(str, args); }
/// <inheritdoc/> public void WriteNet(NetLogLevel level, string str, params object[] args) { Log.Info(string.Format(str, args)); }
public void WriteNet(NetLogLevel level, string str, params object[] args) { Console.WriteLine($" [{DateTime.Now.ToString("T")}] [{level}] {string.Format(str, args)}"); }