Exemplo n.º 1
0
    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);
        }
    }
Exemplo n.º 2
0
 public void writeLog()
 {
     this.nCena    = SceneManager.GetActiveScene().buildIndex;
     this.nomeCena = SceneManager.GetActiveScene().name;
     this.hora     = new DateTime();
     ConexaoMongo.writeLog(this);
     this.setAllNull();
 }
Exemplo n.º 3
0
    public static void writeLog(System.Object ob)
    {
        MongoCollection col = ConexaoMongo.getLogCollection();

        col.Insert(ob);
    }