Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Log
- {
- private static StreamWriter _fileOut;
- static Boolean LogToConsole = true;
- static Boolean LogToFile = true;
- static Log()
- {
- if (LogToFile)
- {
- _fileOut = File.CreateText("Program_out.txt");
- _fileOut.AutoFlush = true;
- }
- }
- public static void WriteLine(string format, params object[] arg)
- {
- if (LogToConsole)
- Console.WriteLine(format, arg);
- if (LogToFile)
- _fileOut.WriteLine(format, arg);
- }
- }
Add Comment
Please, Sign In to add comment