Initializes a new instance of the Logger.

Inheritance: ILogger, ILogHandler
コード例 #1
0
 private void Start()
 {
     _logger = new UnityEngine.Logger(new LabyrinthLogHandler());
     _logger.Log(_tag, "SessionResultAnimation Start.");
     try
     {
         text = GetComponent <Text>();
         if (Menu.SessionList == null)
         {
             text.text = "No Data";
             return;
         }
         else
         if (Menu.SessionList.Sessions.Count != 0)
         {
             text.text = getLastObjectInformation();
         }
         else
         {
             text.text = "No Data";
         }
     }
     catch (System.Exception e)
     {
         _logger.LogException(e);
     }
 }
コード例 #2
0
ファイル: UnityGateway.cs プロジェクト: LBNunes/Avatar
 /// <summary>
 /// Creates a new Gateway with given settings.
 /// </summary>
 /// <param name="uOSSettings"></param>
 public UnityGateway(uOSSettings uOSSettings, Logger logger, UOSApplication app = null)
 {
     this.settings = uOSSettings;
     this.logger = logger;
     this.reflectionServiceCaller = new ReflectionServiceCaller(uOSSettings, this);
     this.app = app;
 }
コード例 #3
0
 static public int LogException(IntPtr l)
 {
     try {
         int argc = LuaDLL.lua_gettop(l);
         if (argc == 2)
         {
             UnityEngine.Logger self = (UnityEngine.Logger)checkSelf(l);
             System.Exception   a1;
             checkType(l, 2, out a1);
             self.LogException(a1);
             pushValue(l, true);
             return(1);
         }
         else if (argc == 3)
         {
             UnityEngine.Logger self = (UnityEngine.Logger)checkSelf(l);
             System.Exception   a1;
             checkType(l, 2, out a1);
             UnityEngine.Object a2;
             checkType(l, 3, out a2);
             self.LogException(a1, a2);
             pushValue(l, true);
             return(1);
         }
         pushValue(l, false);
         LuaDLL.lua_pushstring(l, "No matched override function to call");
         return(2);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
コード例 #4
0
 public static void Log(string message, Logger logger, bool logInEditMode = false)
 {
     if (!logInEditMode && !Application.isPlaying) return;
     if (logged) return;
     if (logger != null) logger(message);
     logged = true;
 }
コード例 #5
0
 public Mummy(int id, GameObject mummy, Func <GameObject, GameObject> create)
 {
     _logger = new UnityEngine.Logger(new LabyrinthLogHandler());
     _logger.Log(MummyClassName, "Mummy Creates.");
     _mummy = mummy;
     Id     = id;
     create(_mummy);
 }
コード例 #6
0
ファイル: Score.cs プロジェクト: BartoshMaxim/Labyrinth
        private void Start()
        {
            _logger = new UnityEngine.Logger(new LabyrinthLogHandler());
            _logger.Log(_tag, "Score Start.");

            _session = GameObject.Find(Session.Session.sessionGameObjectName).GetComponent <Session.Session>();
            _text    = GetComponent <Text>();
        }
コード例 #7
0
        public Zombie(int id, GameObject zombie, Func <GameObject, GameObject> create)
        {
            _logger = new UnityEngine.Logger(new LabyrinthLogHandler());
            _logger.Log(ZombyClassName, "Zombie Creates.");

            _zombie = zombie;
            Id      = id;
            create(_zombie);
        }
コード例 #8
0
        public GamePlayer(string name, float speed, GameObject player)
        {
            _logger = new UnityEngine.Logger(new LabyrinthLogHandler());
            _logger.Log(_tag, "GamePlayer Creates.");

            TimeCreate = DateTime.Now;
            _coins     = 0;
            _player    = player;
            Name       = name;
            Speed      = speed;
        }
コード例 #9
0
 static public int get_logEnabled(IntPtr l)
 {
     try {
         UnityEngine.Logger self = (UnityEngine.Logger)checkSelf(l);
         pushValue(l, true);
         pushValue(l, self.logEnabled);
         return(2);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
コード例 #10
0
        private void Start()
        {
            _logger = new UnityEngine.Logger(new LabyrinthLogHandler());
            _logger.Log(_tag, "Session Start.");

            _rand           = new System.Random();
            _coins          = new List <IBonus>();
            _enemies        = new List <IEnemy>();
            _timer          = new Timer(5000);
            _timer.Elapsed += coinGeneratorControl;
            SessionStart    = false;
        }
コード例 #11
0
 static public int get_filterLogType(IntPtr l)
 {
     try {
         UnityEngine.Logger self = (UnityEngine.Logger)checkSelf(l);
         pushValue(l, true);
         pushEnum(l, (int)self.filterLogType);
         return(2);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
コード例 #12
0
	static public int constructor(IntPtr l) {
		try {
			UnityEngine.Logger o;
			UnityEngine.ILogHandler a1;
			checkType(l,2,out a1);
			o=new UnityEngine.Logger(a1);
			pushValue(l,true);
			pushValue(l,o);
			return 2;
		}
		catch(Exception e) {
			return error(l,e);
		}
	}
コード例 #13
0
 static public int set_logEnabled(IntPtr l)
 {
     try {
         UnityEngine.Logger self = (UnityEngine.Logger)checkSelf(l);
         bool v;
         checkType(l, 2, out v);
         self.logEnabled = v;
         pushValue(l, true);
         return(1);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
コード例 #14
0
 static public int set_filterLogType(IntPtr l)
 {
     try {
         UnityEngine.Logger  self = (UnityEngine.Logger)checkSelf(l);
         UnityEngine.LogType v;
         checkEnum(l, 2, out v);
         self.filterLogType = v;
         pushValue(l, true);
         return(1);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
コード例 #15
0
 static void Logger_filterLogType(JSVCall vc)
 {
     if (vc.bGet)
     {
         UnityEngine.Logger _this = (UnityEngine.Logger)vc.csObj;
         var result = _this.filterLogType;
         JSApi.setEnum((int)JSApi.SetType.Rval, (int)result);
     }
     else
     {
         UnityEngine.LogType arg0  = (UnityEngine.LogType)JSApi.getEnum((int)JSApi.GetType.Arg);
         UnityEngine.Logger  _this = (UnityEngine.Logger)vc.csObj;
         _this.filterLogType = arg0;
     }
 }
コード例 #16
0
 static void Logger_logEnabled(JSVCall vc)
 {
     if (vc.bGet)
     {
         UnityEngine.Logger _this = (UnityEngine.Logger)vc.csObj;
         var result = _this.logEnabled;
         JSApi.setBooleanS((int)JSApi.SetType.Rval, (System.Boolean)(result));
     }
     else
     {
         System.Boolean     arg0  = (System.Boolean)JSApi.getBooleanS((int)JSApi.GetType.Arg);
         UnityEngine.Logger _this = (UnityEngine.Logger)vc.csObj;
         _this.logEnabled = arg0;
     }
 }
コード例 #17
0
// fields

// properties
    static void Logger_logHandler(JSVCall vc)
    {
        if (vc.bGet)
        {
            UnityEngine.Logger _this = (UnityEngine.Logger)vc.csObj;
            var result = _this.logHandler;
            JSMgr.datax.setObject((int)JSApi.SetType.Rval, result);
        }
        else
        {
            UnityEngine.ILogHandler arg0  = (UnityEngine.ILogHandler)JSMgr.datax.getObject((int)JSApi.GetType.Arg);
            UnityEngine.Logger      _this = (UnityEngine.Logger)vc.csObj;
            _this.logHandler = arg0;
        }
    }
コード例 #18
0
 static public int IsLogTypeAllowed(IntPtr l)
 {
     try {
         UnityEngine.Logger  self = (UnityEngine.Logger)checkSelf(l);
         UnityEngine.LogType a1;
         checkEnum(l, 2, out a1);
         var ret = self.IsLogTypeAllowed(a1);
         pushValue(l, true);
         pushValue(l, ret);
         return(2);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
コード例 #19
0
 static public int constructor(IntPtr l)
 {
     try {
         UnityEngine.Logger      o;
         UnityEngine.ILogHandler a1;
         checkType(l, 2, out a1);
         o = new UnityEngine.Logger(a1);
         pushValue(l, true);
         pushValue(l, o);
         return(2);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
コード例 #20
0
    public static int LogFormat(IntPtr l)
    {
        int result;

        try
        {
            int num = LuaDLL.lua_gettop(l);
            if (num == 4)
            {
                UnityEngine.Logger logger = (UnityEngine.Logger)LuaObject.checkSelf(l);
                LogType            logType;
                LuaObject.checkEnum <LogType>(l, 2, out logType);
                string format;
                LuaObject.checkType(l, 3, out format);
                object[] args;
                LuaObject.checkParams <object>(l, 4, out args);
                logger.LogFormat(logType, format, args);
                LuaObject.pushValue(l, true);
                result = 1;
            }
            else if (num == 5)
            {
                UnityEngine.Logger logger2 = (UnityEngine.Logger)LuaObject.checkSelf(l);
                LogType            logType2;
                LuaObject.checkEnum <LogType>(l, 2, out logType2);
                UnityEngine.Object context;
                LuaObject.checkType <UnityEngine.Object>(l, 3, out context);
                string format2;
                LuaObject.checkType(l, 4, out format2);
                object[] args2;
                LuaObject.checkParams <object>(l, 5, out args2);
                logger2.LogFormat(logType2, context, format2, args2);
                LuaObject.pushValue(l, true);
                result = 1;
            }
            else
            {
                LuaObject.pushValue(l, false);
                LuaDLL.lua_pushstring(l, "No matched override function LogFormat to call");
                result = 2;
            }
        }
        catch (Exception e)
        {
            result = LuaObject.error(l, e);
        }
        return(result);
    }
コード例 #21
0
    public static int get_filterLogType(IntPtr l)
    {
        int result;

        try
        {
            UnityEngine.Logger logger = (UnityEngine.Logger)LuaObject.checkSelf(l);
            LuaObject.pushValue(l, true);
            LuaObject.pushEnum(l, (int)logger.filterLogType);
            result = 2;
        }
        catch (Exception e)
        {
            result = LuaObject.error(l, e);
        }
        return(result);
    }
コード例 #22
0
    public static int get_logEnabled(IntPtr l)
    {
        int result;

        try
        {
            UnityEngine.Logger logger = (UnityEngine.Logger)LuaObject.checkSelf(l);
            LuaObject.pushValue(l, true);
            LuaObject.pushValue(l, logger.logEnabled);
            result = 2;
        }
        catch (Exception e)
        {
            result = LuaObject.error(l, e);
        }
        return(result);
    }
コード例 #23
0
ファイル: Coin.cs プロジェクト: BartoshMaxim/Labyrinth
 public Coin(GameObject coin, Func <GameObject, GameObject> create)
 {
     try
     {
         _logger = new UnityEngine.Logger(new LabyrinthLogHandler());
         _logger.Log(tag, "Coin " + _id + " Create.");
         _coin = coin;
         Id    = id;
         id++;
         _coin.GetComponent <CoinUpdate>().Income = Income;
         create(_coin);
     }
     catch (System.Exception e)
     {
         _logger.LogException(e);
     }
 }
コード例 #24
0
    public static int LogError(IntPtr l)
    {
        int result;

        try
        {
            int num = LuaDLL.lua_gettop(l);
            if (num == 3)
            {
                UnityEngine.Logger logger = (UnityEngine.Logger)LuaObject.checkSelf(l);
                string             tag;
                LuaObject.checkType(l, 2, out tag);
                object message;
                LuaObject.checkType <object>(l, 3, out message);
                logger.LogError(tag, message);
                LuaObject.pushValue(l, true);
                result = 1;
            }
            else if (num == 4)
            {
                UnityEngine.Logger logger2 = (UnityEngine.Logger)LuaObject.checkSelf(l);
                string             tag2;
                LuaObject.checkType(l, 2, out tag2);
                object message2;
                LuaObject.checkType <object>(l, 3, out message2);
                UnityEngine.Object context;
                LuaObject.checkType <UnityEngine.Object>(l, 4, out context);
                logger2.LogError(tag2, message2, context);
                LuaObject.pushValue(l, true);
                result = 1;
            }
            else
            {
                LuaObject.pushValue(l, false);
                LuaDLL.lua_pushstring(l, "No matched override function LogError to call");
                result = 2;
            }
        }
        catch (Exception e)
        {
            result = LuaObject.error(l, e);
        }
        return(result);
    }
コード例 #25
0
    public static int set_filterLogType(IntPtr l)
    {
        int result;

        try
        {
            UnityEngine.Logger logger = (UnityEngine.Logger)LuaObject.checkSelf(l);
            LogType            filterLogType;
            LuaObject.checkEnum <LogType>(l, 2, out filterLogType);
            logger.filterLogType = filterLogType;
            LuaObject.pushValue(l, true);
            result = 1;
        }
        catch (Exception e)
        {
            result = LuaObject.error(l, e);
        }
        return(result);
    }
コード例 #26
0
    public static int constructor(IntPtr l)
    {
        int result;

        try
        {
            ILogHandler logHandler;
            LuaObject.checkType <ILogHandler>(l, 2, out logHandler);
            UnityEngine.Logger o = new UnityEngine.Logger(logHandler);
            LuaObject.pushValue(l, true);
            LuaObject.pushValue(l, o);
            result = 2;
        }
        catch (Exception e)
        {
            result = LuaObject.error(l, e);
        }
        return(result);
    }
コード例 #27
0
    public static int set_logHandler(IntPtr l)
    {
        int result;

        try
        {
            UnityEngine.Logger logger = (UnityEngine.Logger)LuaObject.checkSelf(l);
            ILogHandler        logHandler;
            LuaObject.checkType <ILogHandler>(l, 2, out logHandler);
            logger.logHandler = logHandler;
            LuaObject.pushValue(l, true);
            result = 1;
        }
        catch (Exception e)
        {
            result = LuaObject.error(l, e);
        }
        return(result);
    }
コード例 #28
0
 static public int LogFormat__LogType__Object__String__A_Object(IntPtr l)
 {
     try {
         UnityEngine.Logger  self = (UnityEngine.Logger)checkSelf(l);
         UnityEngine.LogType a1;
         checkEnum(l, 2, out a1);
         UnityEngine.Object a2;
         checkType(l, 3, out a2);
         System.String a3;
         checkType(l, 4, out a3);
         System.Object[] a4;
         checkParams(l, 5, out a4);
         self.LogFormat(a1, a2, a3, a4);
         pushValue(l, true);
         return(1);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
コード例 #29
0
 private void Start()
 {
     _logger = new UnityEngine.Logger(new LabyrinthLogHandler());
     _logger.Log(_tag, "SessionResultAnimation Start.");
     try
     {
         if (File.Exists(Path.Combine(Application.dataPath, "session_list.xml")))
         {
             SessionList = SessionList.Load();//read data from xml
         }
         else
         {
             SessionList = new SessionList();
         }
     }
     catch (System.Exception e)
     {
         _logger.LogException(e);
     }
 }
コード例 #30
0
    public static int IsLogTypeAllowed(IntPtr l)
    {
        int result;

        try
        {
            UnityEngine.Logger logger = (UnityEngine.Logger)LuaObject.checkSelf(l);
            LogType            logType;
            LuaObject.checkEnum <LogType>(l, 2, out logType);
            bool b = logger.IsLogTypeAllowed(logType);
            LuaObject.pushValue(l, true);
            LuaObject.pushValue(l, b);
            result = 2;
        }
        catch (Exception e)
        {
            result = LuaObject.error(l, e);
        }
        return(result);
    }
コード例 #31
0
 static public int LogFormat(IntPtr l)
 {
     try {
         int argc = LuaDLL.lua_gettop(l);
         if (argc == 4)
         {
             UnityEngine.Logger  self = (UnityEngine.Logger)checkSelf(l);
             UnityEngine.LogType a1;
             checkEnum(l, 2, out a1);
             System.String a2;
             checkType(l, 3, out a2);
             System.Object[] a3;
             checkParams(l, 4, out a3);
             self.LogFormat(a1, a2, a3);
             pushValue(l, true);
             return(1);
         }
         else if (argc == 5)
         {
             UnityEngine.Logger  self = (UnityEngine.Logger)checkSelf(l);
             UnityEngine.LogType a1;
             checkEnum(l, 2, out a1);
             UnityEngine.Object a2;
             checkType(l, 3, out a2);
             System.String a3;
             checkType(l, 4, out a3);
             System.Object[] a4;
             checkParams(l, 5, out a4);
             self.LogFormat(a1, a2, a3, a4);
             pushValue(l, true);
             return(1);
         }
         pushValue(l, false);
         LuaDLL.lua_pushstring(l, "No matched override function LogFormat to call");
         return(2);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
コード例 #32
0
    public static int LogException(IntPtr l)
    {
        int result;

        try
        {
            int num = LuaDLL.lua_gettop(l);
            if (num == 2)
            {
                UnityEngine.Logger logger = (UnityEngine.Logger)LuaObject.checkSelf(l);
                Exception          exception;
                LuaObject.checkType <Exception>(l, 2, out exception);
                logger.LogException(exception);
                LuaObject.pushValue(l, true);
                result = 1;
            }
            else if (num == 3)
            {
                UnityEngine.Logger logger2 = (UnityEngine.Logger)LuaObject.checkSelf(l);
                Exception          exception2;
                LuaObject.checkType <Exception>(l, 2, out exception2);
                UnityEngine.Object context;
                LuaObject.checkType <UnityEngine.Object>(l, 3, out context);
                logger2.LogException(exception2, context);
                LuaObject.pushValue(l, true);
                result = 1;
            }
            else
            {
                LuaObject.pushValue(l, false);
                LuaDLL.lua_pushstring(l, "No matched override function LogException to call");
                result = 2;
            }
        }
        catch (Exception e)
        {
            result = LuaObject.error(l, e);
        }
        return(result);
    }
コード例 #33
0
        private void Start()
        {
            _logger = new UnityEngine.Logger(new LabyrinthLogHandler());
            _logger.Log(_tag, "Statistics Start.");

            try
            {
                _textResult = GetComponent <Text>();

                if (File.Exists(Path.Combine(Application.dataPath, "session_list.xml")))
                {
                    _textResult.text = getTable(SessionList.Load().Sessions);
                }
                else
                {
                    _textResult.text = "No data";
                }
            }
            catch (System.Exception e)
            {
                _logger.LogException(e);
            }
        }
コード例 #34
0
		public void Awake() {

			this.logger = new Logger() {
				enabled = 
					(Application.isEditor == true && (this.textLogs & ActiveType.InEditor) != 0) ||
					(Application.isEditor == false && (this.textLogs & ActiveType.InBuild) != 0)
			};

			WindowSystemLogger.instance = this;

		}