using System;
using System.Collections.Generic;
using System.Text;
using System.Threading;
using System.IO;

namespace USB_interface
{
    public class Loging
    {
        public Loging()
        {
        }


        public void StartLoging()
        {
            file = new StreamWriter(".\\log" + ".txt", true);
        }

        public void WriteLog(string msg)
        {
            file.WriteLine(DateTime.Now.ToString() + ": " + msg);
            txt += DateTime.Now.ToString() + ": " + msg + "\n";
            file.Flush();
        }

        public string GetMessages()
        {
            return txt;
        }

        public void Close()
        {
            file.Close();
            txt = String.Empty;
        }

        StreamWriter file;
        String txt;
    }
}
