libcruft-util/log/sink/ostream.hpp

32 lines
653 B
C++
Raw Normal View History

2020-04-21 10:55:36 +10:00
/*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* Copyright 2020, Danny Robson <danny@nerdcruft.net>
*/
#pragma once
#include "base.hpp"
#include <string>
#include <fstream>
#include <filesystem>
namespace cruft::log::sink {
class ostream : public crtp<ostream> {
public:
ostream (
std::string name,
std::filesystem::path const &path
);
void write (packet const&) override;
private:
std::ofstream m_output;
};
}