Exemple #1
0
        void Awake()
        {
            if (instance != null)
            {
                Destroy(gameObject);
                return;
            }
            instance = this;
            DontDestroyOnLoad(gameObject);
            //prepare log filenames
            var date = DateTime.Now.ToString("yyyy-MM-dd_HH-ss");

            backup_file = "Player-" + date + ".log";
            logfile     = "AT_Utils-Debug-" + date + ".log";
            unity_log   = Environment.ExpandEnvironmentVariables(unity_log);
            //start log backup routine
            if (File.Exists(unity_log))
            {
                StartCoroutine(backup_log());
            }
            else
            {
                Log("Unity log is not here:\n{}", unity_log);
            }
        }
Exemple #2
0
        public static void Log(string msg)
        {
            msg = prepare_message(msg);
            UnityEngine.Debug.Log(msg);
#if DEBUG
            BackupLogger.LogRaw(msg);
#endif
        }
Exemple #3
0
 private void OnDestroy()
 {
     if (instance != this)
     {
         return;
     }
     instance = null;
 }
Exemple #4
0
        public static void Log(string msg, params object[] args)
        {
            msg = prepare_message(msg);
            if (args.Length > 0)
            {
                convert_args(args);
                msg = Format(msg, args);
            }
            UnityEngine.Debug.Log(msg);
#if DEBUG
            BackupLogger.LogRaw(msg);
#endif
        }