static void Main(string[] args) { log.Error("Main", new Exception("发生了一个异常")); //错误 log.Fatal("Main", new Exception("发生了一个致命错误")); //严重错误 log.Info("Main", "信息"); //记录一般信息 log.Debug("Main", "调试信息"); //记录调试信息 log.Warn("Main", "警告"); //记录警告信息 Console.ReadKey(); }
public void GetCategories() { #if !DEBUG try { #endif this.Categories = new List <WordPressCategory>(proxy.getWpCategories(this.User.blogid, this.User.username, this.User.password)); #if !DEBUG } catch (Exception ex) { XLog.Warn("Error", ": Couldn't get tags."); XLog.Warn("Error", ": {0}", ex.ToString()); } #endif OnPropertyChanged("CategoryInfo"); }
public void GetTags() { // no get formats function! #if !DEBUG try { #endif this.Tags = new List <TagInfo>(proxy.getTags(this.User.blogid, this.User.username, this.User.password)); #if !DEBUG } catch (Exception ex) { XLog.Warn("Error", ": Couldn't get tags."); XLog.Warn("Error", ": {0}", ex.ToString()); } #endif OnPropertyChanged("Tags"); }