示例#1
0
        /*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;
            }
        }
示例#2
0
 public void WriteNet(NetLogLevel level, string str, params object[] args)
 {
     if (level == NetLogLevel.Error || level == NetLogLevel.Warning)
     {
         Assert.Fail(str, args);
     }
 }
示例#3
0
        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);
        }
示例#4
0
 private void WriteNet(NetLogLevel info, string str, params object[] args)
 {
     if (!_config.ServerLoggingConfig.Logging || !_config.ServerLoggingConfig.ServerLogging)
     {
         return;
     }
     NetDebug.Logger?.WriteNet(info, str, args);
 }
示例#5
0
 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));
     }
 }
示例#6
0
        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);
                }
            }
        }
示例#7
0
        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;
            }
        }
示例#8
0
文件: GameServer.cs 项目: ayuexs/C-
 public void WriteNet(NetLogLevel level, string str, params object[] args)
 {
     Debug.LogFormat(str, args);
 }
示例#9
0
 internal static void WriteForce(NetLogLevel level, string str, params object[] args)
 {
     WriteLogic(level, str, args);
 }
示例#10
0
 public void WriteNet(NetLogLevel level, string str, params object[] args)
 {
     Console.WriteLine(str, args);
 }
示例#11
0
 public void WriteNet(NetLogLevel level, string str, params object[] args)
 {
     logger.InfoFormat(str, args);
 }
示例#12
0
 /// <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)}");
 }