blob: 85857c206b559e1d5b25a0cdcf15bfaab9a3895c (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#pragma once
#include "log-target.h"
namespace ns_log {
class LogTargetFd : public LogTarget {
private:
int _fd;
bool _istty;
LogTargetFd() = delete;
LogTargetFd(const LogTargetFd&) = delete;
LogTargetFd& operator= (const LogTargetFd) = delete;
public:
LogTargetFd(int fd_spec, const char *target);
int write(const char *buf, int len) override;
~LogTargetFd();
bool makeHumanReadable() const override { return _istty; }
};
} // end namespace log
|