Skip to content
Permalink
396a0d7358
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
42 lines (34 sloc) 1.04 KB
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Controls;
namespace DataScraperGUI.Infrastructure {
class Logger {
private TextBox logBox = null;
public Logger (TextBox lBox) {
logBox = lBox;
}
private void Log (string message, string severity) {
var sb = new StringBuilder();
sb.Append("[");
sb.Append(DateTime.Now.ToLocalTime());
sb.Append("] ");
sb.Append(severity);
sb.Append(": ");
sb.Append(message);
sb.AppendLine();
sb.Append(logBox.Text);
logBox.Text = sb.ToString();
}
public void LogMessage (string message) {
Log(message, "MESSAGE");
}
public void LogWarning (string message) {
Log(message, "WARNING");
}
public void LogError (string message) {
Log(message, "ERROR");
}
}
}