blob: 6758b9664d23272c001cb2d9d3383bc8459c8cf2 (
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
26
27
28
29
|
// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#pragma once
#include "log-target.h"
#include <sys/types.h>
#include <sys/stat.h>
namespace ns_log {
class LogTargetFile : public LogTarget {
private:
char _fname[256];
enum FailState {
FS_OK, FS_CHECKING, FS_ROTATING, FS_FAILED
} _failstate;
LogTargetFile();
LogTargetFile(const LogTargetFile&);
LogTargetFile& operator =(const LogTargetFile&);
public:
explicit LogTargetFile(const char *target);
~LogTargetFile();
int write(const char *buf, int len) override;
};
} // end namespace log
|