public static Action <LogData, string> CreateWebSocketProxyLoggerOutput(UnityEngine.ILogger logger)
        {
            const string tag = "WebSocket";

            return((data, s) =>
            {
                switch (data.Level)
                {
                case LogLevel.Trace:
                case LogLevel.Debug:
                case LogLevel.Info:
                    logger.Log(tag, data.Message);
                    break;

                case LogLevel.Warn:
                    logger.LogWarning(tag, data.Message);
                    break;

                case LogLevel.Error:
                case LogLevel.Fatal:
                    logger.LogError(tag, data.Message);
                    break;

                default:
                    throw new ArgumentOutOfRangeException();
                }
            });
        }
Exemplo n.º 2
0
        public void Log(ELogType logType, string log)
        {
            _strBuilder.Clear();

            _strBuilder.AppendFormat(FORMAT,
                                     LOG_COLORS[(int)logType],
                                     DateTime.Now.ToString("HH:mm:ss"),
                                     log);

            _uLogger.Log(UnityEngine.LogType.Log, logType.ToString(), _strBuilder.ToString());
        }
        static StackObject *Log_11(ILIntepreter __intp, StackObject *__esp, IList <object> __mStack, CLRMethod __method, bool isNewObj)
        {
            CSHotFix.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject *ptr_of_this_method;
            StackObject *__ret = ILIntepreter.Minus(__esp, 2);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            System.Object @message = (System.Object) typeof(System.Object).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
            __intp.Free(ptr_of_this_method);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
            UnityEngine.ILogger instance_of_this_method = (UnityEngine.ILogger) typeof(UnityEngine.ILogger).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
            __intp.Free(ptr_of_this_method);

            instance_of_this_method.Log(@message);

            return(__ret);
        }
Exemplo n.º 4
0
 public void Log(Domain.UseCase.ISystemMessage message) => logger.Log(SystemMessageTranslator.Translate(message));
Exemplo n.º 5
0
        static int _m_Log(RealStatePtr L)
        {
            ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);


            UnityEngine.ILogger __cl_gen_to_be_invoked = (UnityEngine.ILogger)translator.FastGetCSObj(L, 1);


            int __gen_param_count = LuaAPI.lua_gettop(L);

            try {
                if (__gen_param_count == 2 && translator.Assignable <object>(L, 2))
                {
                    object message = translator.GetObject(L, 2, typeof(object));

                    __cl_gen_to_be_invoked.Log(message);



                    return(0);
                }
                if (__gen_param_count == 3 && translator.Assignable <UnityEngine.LogType>(L, 2) && translator.Assignable <object>(L, 3))
                {
                    UnityEngine.LogType logType; translator.Get(L, 2, out logType);
                    object message = translator.GetObject(L, 3, typeof(object));

                    __cl_gen_to_be_invoked.Log(logType, message);



                    return(0);
                }
                if (__gen_param_count == 3 && (LuaAPI.lua_isnil(L, 2) || LuaAPI.lua_type(L, 2) == LuaTypes.LUA_TSTRING) && translator.Assignable <object>(L, 3))
                {
                    string tag     = LuaAPI.lua_tostring(L, 2);
                    object message = translator.GetObject(L, 3, typeof(object));

                    __cl_gen_to_be_invoked.Log(tag, message);



                    return(0);
                }
                if (__gen_param_count == 4 && translator.Assignable <UnityEngine.LogType>(L, 2) && translator.Assignable <object>(L, 3) && translator.Assignable <UnityEngine.Object>(L, 4))
                {
                    UnityEngine.LogType logType; translator.Get(L, 2, out logType);
                    object             message = translator.GetObject(L, 3, typeof(object));
                    UnityEngine.Object context = (UnityEngine.Object)translator.GetObject(L, 4, typeof(UnityEngine.Object));

                    __cl_gen_to_be_invoked.Log(logType, message, context);



                    return(0);
                }
                if (__gen_param_count == 4 && translator.Assignable <UnityEngine.LogType>(L, 2) && (LuaAPI.lua_isnil(L, 3) || LuaAPI.lua_type(L, 3) == LuaTypes.LUA_TSTRING) && translator.Assignable <object>(L, 4))
                {
                    UnityEngine.LogType logType; translator.Get(L, 2, out logType);
                    string tag     = LuaAPI.lua_tostring(L, 3);
                    object message = translator.GetObject(L, 4, typeof(object));

                    __cl_gen_to_be_invoked.Log(logType, tag, message);



                    return(0);
                }
                if (__gen_param_count == 4 && (LuaAPI.lua_isnil(L, 2) || LuaAPI.lua_type(L, 2) == LuaTypes.LUA_TSTRING) && translator.Assignable <object>(L, 3) && translator.Assignable <UnityEngine.Object>(L, 4))
                {
                    string             tag     = LuaAPI.lua_tostring(L, 2);
                    object             message = translator.GetObject(L, 3, typeof(object));
                    UnityEngine.Object context = (UnityEngine.Object)translator.GetObject(L, 4, typeof(UnityEngine.Object));

                    __cl_gen_to_be_invoked.Log(tag, message, context);



                    return(0);
                }
                if (__gen_param_count == 5 && translator.Assignable <UnityEngine.LogType>(L, 2) && (LuaAPI.lua_isnil(L, 3) || LuaAPI.lua_type(L, 3) == LuaTypes.LUA_TSTRING) && translator.Assignable <object>(L, 4) && translator.Assignable <UnityEngine.Object>(L, 5))
                {
                    UnityEngine.LogType logType; translator.Get(L, 2, out logType);
                    string             tag     = LuaAPI.lua_tostring(L, 3);
                    object             message = translator.GetObject(L, 4, typeof(object));
                    UnityEngine.Object context = (UnityEngine.Object)translator.GetObject(L, 5, typeof(UnityEngine.Object));

                    __cl_gen_to_be_invoked.Log(logType, tag, message, context);



                    return(0);
                }
            } catch (System.Exception __gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + __gen_e));
            }

            return(LuaAPI.luaL_error(L, "invalid arguments to UnityEngine.ILogger.Log!"));
        }
 static public int Log(IntPtr l)
 {
     try {
         int argc = LuaDLL.lua_gettop(l);
         if (argc == 2)
         {
             UnityEngine.ILogger self = (UnityEngine.ILogger)checkSelf(l);
             System.Object       a1;
             checkType(l, 2, out a1);
             self.Log(a1);
             pushValue(l, true);
             return(1);
         }
         else if (matchType(l, argc, 2, typeof(string), typeof(System.Object)))
         {
             UnityEngine.ILogger self = (UnityEngine.ILogger)checkSelf(l);
             System.String       a1;
             checkType(l, 2, out a1);
             System.Object a2;
             checkType(l, 3, out a2);
             self.Log(a1, a2);
             pushValue(l, true);
             return(1);
         }
         else if (matchType(l, argc, 2, typeof(UnityEngine.LogType), typeof(System.Object)))
         {
             UnityEngine.ILogger self = (UnityEngine.ILogger)checkSelf(l);
             UnityEngine.LogType a1;
             checkEnum(l, 2, out a1);
             System.Object a2;
             checkType(l, 3, out a2);
             self.Log(a1, a2);
             pushValue(l, true);
             return(1);
         }
         else if (matchType(l, argc, 2, typeof(string), typeof(System.Object), typeof(UnityEngine.Object)))
         {
             UnityEngine.ILogger self = (UnityEngine.ILogger)checkSelf(l);
             System.String       a1;
             checkType(l, 2, out a1);
             System.Object a2;
             checkType(l, 3, out a2);
             UnityEngine.Object a3;
             checkType(l, 4, out a3);
             self.Log(a1, a2, a3);
             pushValue(l, true);
             return(1);
         }
         else if (matchType(l, argc, 2, typeof(UnityEngine.LogType), typeof(System.Object), typeof(UnityEngine.Object)))
         {
             UnityEngine.ILogger self = (UnityEngine.ILogger)checkSelf(l);
             UnityEngine.LogType a1;
             checkEnum(l, 2, out a1);
             System.Object a2;
             checkType(l, 3, out a2);
             UnityEngine.Object a3;
             checkType(l, 4, out a3);
             self.Log(a1, a2, a3);
             pushValue(l, true);
             return(1);
         }
         else if (matchType(l, argc, 2, typeof(UnityEngine.LogType), typeof(string), typeof(System.Object)))
         {
             UnityEngine.ILogger self = (UnityEngine.ILogger)checkSelf(l);
             UnityEngine.LogType a1;
             checkEnum(l, 2, out a1);
             System.String a2;
             checkType(l, 3, out a2);
             System.Object a3;
             checkType(l, 4, out a3);
             self.Log(a1, a2, a3);
             pushValue(l, true);
             return(1);
         }
         else if (argc == 5)
         {
             UnityEngine.ILogger self = (UnityEngine.ILogger)checkSelf(l);
             UnityEngine.LogType a1;
             checkEnum(l, 2, out a1);
             System.String a2;
             checkType(l, 3, out a2);
             System.Object a3;
             checkType(l, 4, out a3);
             UnityEngine.Object a4;
             checkType(l, 5, out a4);
             self.Log(a1, a2, a3, a4);
             pushValue(l, true);
             return(1);
         }
         pushValue(l, false);
         LuaDLL.lua_pushstring(l, "No matched override function Log to call");
         return(2);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
Exemplo n.º 7
0
 static public int Log(IntPtr l)
 {
     try {
                     #if DEBUG
         var    method     = System.Reflection.MethodBase.GetCurrentMethod();
         string methodName = GetMethodName(method);
                     #if UNITY_5_5_OR_NEWER
         UnityEngine.Profiling.Profiler.BeginSample(methodName);
                     #else
         Profiler.BeginSample(methodName);
                     #endif
                     #endif
         int argc = LuaDLL.lua_gettop(l);
         if (argc == 2)
         {
             UnityEngine.ILogger self = (UnityEngine.ILogger)checkSelf(l);
             System.Object       a1;
             checkType(l, 2, out a1);
             self.Log(a1);
             pushValue(l, true);
             return(1);
         }
         else if (matchType(l, argc, 2, typeof(UnityEngine.LogType), typeof(System.Object)))
         {
             UnityEngine.ILogger self = (UnityEngine.ILogger)checkSelf(l);
             UnityEngine.LogType a1;
             a1 = (UnityEngine.LogType)LuaDLL.luaL_checkinteger(l, 2);
             System.Object a2;
             checkType(l, 3, out a2);
             self.Log(a1, a2);
             pushValue(l, true);
             return(1);
         }
         else if (matchType(l, argc, 2, typeof(string), typeof(System.Object)))
         {
             UnityEngine.ILogger self = (UnityEngine.ILogger)checkSelf(l);
             System.String       a1;
             checkType(l, 2, out a1);
             System.Object a2;
             checkType(l, 3, out a2);
             self.Log(a1, a2);
             pushValue(l, true);
             return(1);
         }
         else if (matchType(l, argc, 2, typeof(UnityEngine.LogType), typeof(System.Object), typeof(UnityEngine.Object)))
         {
             UnityEngine.ILogger self = (UnityEngine.ILogger)checkSelf(l);
             UnityEngine.LogType a1;
             a1 = (UnityEngine.LogType)LuaDLL.luaL_checkinteger(l, 2);
             System.Object a2;
             checkType(l, 3, out a2);
             UnityEngine.Object a3;
             checkType(l, 4, out a3);
             self.Log(a1, a2, a3);
             pushValue(l, true);
             return(1);
         }
         else if (matchType(l, argc, 2, typeof(UnityEngine.LogType), typeof(string), typeof(System.Object)))
         {
             UnityEngine.ILogger self = (UnityEngine.ILogger)checkSelf(l);
             UnityEngine.LogType a1;
             a1 = (UnityEngine.LogType)LuaDLL.luaL_checkinteger(l, 2);
             System.String a2;
             checkType(l, 3, out a2);
             System.Object a3;
             checkType(l, 4, out a3);
             self.Log(a1, a2, a3);
             pushValue(l, true);
             return(1);
         }
         else if (matchType(l, argc, 2, typeof(string), typeof(System.Object), typeof(UnityEngine.Object)))
         {
             UnityEngine.ILogger self = (UnityEngine.ILogger)checkSelf(l);
             System.String       a1;
             checkType(l, 2, out a1);
             System.Object a2;
             checkType(l, 3, out a2);
             UnityEngine.Object a3;
             checkType(l, 4, out a3);
             self.Log(a1, a2, a3);
             pushValue(l, true);
             return(1);
         }
         else if (argc == 5)
         {
             UnityEngine.ILogger self = (UnityEngine.ILogger)checkSelf(l);
             UnityEngine.LogType a1;
             a1 = (UnityEngine.LogType)LuaDLL.luaL_checkinteger(l, 2);
             System.String a2;
             checkType(l, 3, out a2);
             System.Object a3;
             checkType(l, 4, out a3);
             UnityEngine.Object a4;
             checkType(l, 5, out a4);
             self.Log(a1, a2, a3, a4);
             pushValue(l, true);
             return(1);
         }
         pushValue(l, false);
         LuaDLL.lua_pushstring(l, "No matched override function Log to call");
         return(2);
     }
     catch (Exception e) {
         return(error(l, e));
     }
             #if DEBUG
     finally {
                     #if UNITY_5_5_OR_NEWER
         UnityEngine.Profiling.Profiler.EndSample();
                     #else
         Profiler.EndSample();
                     #endif
     }
             #endif
 }