#ifndef ASH_SYSTEM_DIAGNOSTICS_ASYNC_LOG_H_
#define ASH_SYSTEM_DIAGNOSTICS_ASYNC_LOG_H_
#include <string>
#include "ash/ash_export.h"
#include "base/files/file_path.h"
#include "base/memory/scoped_refptr.h"
#include "base/task/sequenced_task_runner.h"
namespace ash {
namespace diagnostics {
class ASH_EXPORT AsyncLog {
public:
explicit AsyncLog(const base::FilePath& file_path);
AsyncLog(const AsyncLog&) = delete;
AsyncLog& operator=(const AsyncLog&) = delete;
~AsyncLog();
void Append(const std::string& text);
std::string GetContents() const;
void SetTaskRunnerForTesting(
const scoped_refptr<base::SequencedTaskRunner>& task_runner);
private:
const base::FilePath file_path_;
scoped_refptr<base::SequencedTaskRunner> sequenced_task_runner_;
};
}
}
#endif