public static void writeLog(LoggerMongo log) { if (!ConexaoMongo.ativo) { return; } try{ MongoCollection col = ConexaoMongo.getLogCollection(); col.Insert(log); Debug.Log(" Insert LOG"); } catch (BsonSerializationException e) { Debug.LogError("NÃO FOI POSSÍVEL GRAVAR LOG " + "\n classe: " + log.className + "" + "\n msg: " + e.Message + "" + "\n obg: " + log.attachedObj + "" + "\n acao:" + log.acao + "\n tipo excecao: " + e.GetType()); //Desativa o write log // ConexaoMongo.ativo = false; return; } catch (MongoConnectionException e) { ConexaoMongo.ativo = false; Debug.LogError("Desativando banco"); } catch (Exception e) { // ConexaoMongo.ativo = false; Debug.LogError("banco:" + e); } }
private void Awake() { logg = new LoggerMongo(this.GetType()); logg.grupoID = this.GetInstanceID(); logg.attachedObj = this; logg.acao = "INICIANDO"; logg.msg = "INICIANDO DINO"; logg.writeLog(); }
void Awake() { DontDestroyOnLoad(this); Debug.LogError("LevelInfo " + this.GetInstanceID()); if (FindObjectsOfType(this.GetType()).Length > 1) { Destroy(gameObject); } id = this.GetInstanceID(); logg = new LoggerMongo(this.GetType()); logg.classId = this.GetInstanceID(); logg.msg = "INICIANDO LVL INFO"; logg.acao = "INICIANDO"; logg.writeLog(); SceneManager.sceneLoaded += OnLevelFinishedLoading; SceneManager.sceneUnloaded += OnSceneUnload; }
void Awake() { logg = new LoggerMongo(this.GetType()); }
private void Start() { logg = new LoggerMongo(this.GetType()); }