/// <summary> /// Method that write on the log /// </summary> /// <param name="message"></param> public static void WriteOnTheLog(string message, Global.TipoLog tipoLog) { if (Global.log_system != Global.TipoLog.DETALHADO && tipoLog == Global.TipoLog.DETALHADO) { return; } string directory_ach = Global.app_logs_directoty; if (DateTime.Now.Day < 10) { directory_ach += "0" + DateTime.Now.Day; } else { directory_ach += DateTime.Now.Day; } if (DateTime.Now.Month < 10) { directory_ach += "0" + DateTime.Now.Month; } else { directory_ach += DateTime.Now.Month; } directory_ach += DateTime.Now.Year + ".log"; CL_Files file = new CL_Files(directory_ach); file.WriteOnTheEnd(DateTime.Now.ToString() + "- " + (tipoLog == Global.TipoLog.DETALHADO ? "DETALHADO -" : "SIMPLES -") + message + "\n"); file = null; }
/// <summary> /// Método que escreve em arquivo a saída do sistema /// </summary> /// <param name="result"></param> /// <returns></returns> private static bool EscreveSaida(StringBuilder result) { Util.CL_Files.WriteOnTheLog("SQLiteExecutter.EscreveSaida", Global.TipoLog.DETALHADO); try { CL_Files arquivo = new CL_Files(Global.app_out_directory + "comandos_sql.sql"); arquivo.WriteOnTheEnd(result.ToString()); } catch (Exception e) { Util.CL_Files.WriteOnTheLog("Error: " + e.Message, Global.TipoLog.SIMPLES); return(false); } return(true); }