public static void Write(string message) //Write to the same line. { var logLine = new Logger.logFile(); Console.Write(message); logLine.log(message, "Output"); }
//An integrated alternative to "Console.Write" which includs logging. public static void writeOut(string message) //Writes to a new line { var logLine = new Logger.logFile(); Console.WriteLine(message); logLine.log(message, "Output"); //And logs the message }
public static void Start() { var logLine = new Logger.logFile(); logLine.logCreate(); //Create or overwrite the log file to be used during runtime Output.writeOut("----- C# Git Diff Implementation -----"); Output.writeOut("Input 'help' for directions on how to use."); //A few niceties to help with console usability. }
static void Main(string[] args) { UserInput input = new UserInput(); CommandParse commandParse = new CommandParse(); var logLine = new Logger.logFile(); //Instantiate the loggin class, as we have an input present. Setup.Start(); //Call one-time run setup class to make the console pretty. while (true) { string command = input.In(); //Take the user's input logLine.log(command, "Input"); //Log it commandParse.parse(command); //And decide the action to take } }