Exemplo n.º 1
0
        public void Escrever <T>(Expression <Func <bool, T> > parametros)
        {
            StackTrace     stackTrace    = new StackTrace();
            ILogConstrutor logConstrutor = LogFabrica.Criar();

            logConstrutor.Classe(stackTrace.GetFrame(1).GetMethod().ReflectedType.Name);

            try
            {
                ILog log = logConstrutor.Metodo(stackTrace.GetFrame(1).GetMethod().Name).Parametro(parametros).Construir();
                ConstruirParaOLevel(log);
            }
            catch (Exception e)
            {
                logConstrutor.Metodo(stackTrace.GetFrame(1).GetMethod().Name).Excecao(e).Construir().ParaErro();
            }
        }
Exemplo n.º 2
0
        public void Escrever(string mensagem)
        {
            StackTrace     stackTrace    = new StackTrace();
            ILogConstrutor logConstrutor = LogFabrica.Criar();

            logConstrutor.Classe(stackTrace.GetFrame(1).GetMethod().ReflectedType.Name);

            try
            {
                ILog log = logConstrutor.Metodo(stackTrace.GetFrame(1).GetMethod().Name).Mensagem(mensagem).Construir();
                ConstruirParaOLevel(log);
            }
            catch (Exception e)
            {
                logConstrutor.Metodo(stackTrace.GetFrame(1).GetMethod().Name).Excecao(e).Construir().ParaErro();
            }
        }