aboutsummaryrefslogtreecommitdiffstats
path: root/vespalog/src/vespa/log/log-target-file.h
blob: dc1fc3fd7246f1ad41ed5034eca3270700d7f769 (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 Vespa.ai. 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