@Override
    public void run()
    {
        while (enabled)
        {
            if (logQueue.size() != 0)
            {
                StringBuilder stringBuilder = new StringBuilder();
                while (logQueue.size() != 0)
                {
                    stringBuilder.append(logQueue.poll());
                }

                if (file.exists() && file.isFile())
                {
                    FileWriter writer = null;
                    try
                    {
                        writer = new FileWriter(file, true);
                        writer.append(stringBuilder.toString());
                    }
                    catch (IOException e)
                    {
                        Log.w("Unable to write to log file.");
                        e.printStackTrace();
                    }
                    finally
                    {
                        try
                        {
                            if (writer != null)
                            {
                                writer.close();
                            }
                        }
                        catch (IOException e)
                        {
                            Log.w("Unable to close writer for log file.");
                            e.printStackTrace();
                        }
                    }
                }
            }
            try
            {
                Thread.sleep(100);
            }
            catch (InterruptedException e)
            {
                e.printStackTrace();
            }

        }
    }