Esempio n. 1
0
 /// <summary>
 /// Initialize the application Log
 /// </summary>
 private static void InitLog()
 {
     //Crea el archivo de Log
     if (!File.Exists(LogPath))
     {
         File.WriteAllLines(LogPath, new String[] { });
     }
     Ghost = new WiredGhost(new FileInfo(LogPath), true);
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="KaishinConfiguration"/> class.
 /// </summary>
 /// <param name="appName">Name of the application.</param>
 /// <param name="logIsEnabled">if set to <c>true</c> [log is enabled].</param>
 /// <exception cref="GodModeException"></exception>
 public KaishinConfiguration(String appName, Boolean logIsEnabled = false)
 {
     try
     {
         this.Configuration = new ConfigurationMedaka(this.ConfigurationFile, appName);
         FileInfo logFile = new FileInfo(Path.Combine(this.AppDirectory.FullName, this.AppLogName));
         this.Log           = new WiredGhost(logFile, logIsEnabled);
         this.Log.GhostMode = logIsEnabled;
         this.InitConfiguration(this.Configuration);
         this.Configuration.MedakaApp.Xml.Save();
     }
     catch (Exception exc)
     {
         exc.CreateNamelessException <GodModeException>(exc.Message);
     }
 }