Optimize file log.

This commit is contained in:
XMRig 2020-02-23 06:52:23 +07:00
parent 031e09fede
commit ead441f5db
No known key found for this signature in database
GPG key ID: 446A53638BE94409
5 changed files with 123 additions and 34 deletions

View file

@ -6,8 +6,8 @@
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
* Copyright 2019 Spudz76 <https://github.com/Spudz76>
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com>
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -27,9 +27,7 @@
#define XMRIG_FILELOG_H
typedef struct uv_fs_s uv_fs_t;
#include "base/io/log/FileLogWriter.h"
#include "base/kernel/interfaces/ILogBackend.h"
@ -41,14 +39,11 @@ class FileLog : public ILogBackend
public:
FileLog(const char *fileName);
protected:
void print(int level, const char *line, size_t offset, size_t size, bool colors) override;
private:
static void onWrite(uv_fs_t *req);
int m_file;
FileLogWriter m_writer;
};