proxygen
Main Page
Related Pages
Namespaces
Classes
Files
Examples
File List
File Members
ImmediateFileWriter.h
Go to the documentation of this file.
1
/*
2
* Copyright 2017-present Facebook, Inc.
3
*
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
* you may not use this file except in compliance with the License.
6
* You may obtain a copy of the License at
7
*
8
* http://www.apache.org/licenses/LICENSE-2.0
9
*
10
* Unless required by applicable law or agreed to in writing, software
11
* distributed under the License is distributed on an "AS IS" BASIS,
12
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
* See the License for the specific language governing permissions and
14
* limitations under the License.
15
*/
16
#pragma once
17
18
#include <
folly/File.h
>
19
#include <
folly/Range.h
>
20
#include <
folly/logging/LogWriter.h
>
21
22
namespace
folly
{
23
36
class
ImmediateFileWriter
:
public
LogWriter
{
37
public
:
42
explicit
ImmediateFileWriter
(
folly::StringPiece
path);
43
47
explicit
ImmediateFileWriter
(
folly::File
&& file);
48
49
using
LogWriter::writeMessage
;
50
void
writeMessage
(
folly::StringPiece
buffer
,
uint32_t
flags
= 0)
override
;
51
void
flush
()
override
;
52
56
bool
ttyOutput
()
const override
{
57
return
isatty(
file_
.
fd
());
58
}
59
63
const
folly::File
&
getFile
()
const
{
64
return
file_
;
65
}
66
67
private
:
68
ImmediateFileWriter
(
ImmediateFileWriter
const
&) =
delete
;
69
ImmediateFileWriter
&
operator=
(
ImmediateFileWriter
const
&) =
delete
;
70
71
folly::File
file_
;
72
};
73
}
// namespace folly
folly::ImmediateFileWriter::ttyOutput
bool ttyOutput() const override
Definition:
ImmediateFileWriter.h:56
folly::ImmediateFileWriter::file_
folly::File file_
Definition:
ImmediateFileWriter.h:71
buffer
std::vector< uint8_t > buffer(kBufferSize+16)
folly::ImmediateFileWriter
Definition:
ImmediateFileWriter.h:36
flags
flags
Definition:
http_parser.h:127
LogWriter.h
folly::ImmediateFileWriter::operator=
ImmediateFileWriter & operator=(ImmediateFileWriter const &)=delete
folly::File
Definition:
File.h:37
folly
—— Concurrent Priority Queue Implementation ——
Definition:
AtomicBitSet.h:29
File.h
folly::LogWriter
Definition:
LogWriter.h:25
Range.h
folly::ImmediateFileWriter::getFile
const folly::File & getFile() const
Definition:
ImmediateFileWriter.h:63
folly::ImmediateFileWriter::flush
void flush() override
Definition:
ImmediateFileWriter.cpp:52
folly::File::fd
int fd() const
Definition:
File.h:85
folly::ImmediateFileWriter::ImmediateFileWriter
ImmediateFileWriter(folly::StringPiece path)
Definition:
ImmediateFileWriter.cpp:27
folly::LogWriter::writeMessage
virtual void writeMessage(folly::StringPiece buffer, uint32_t flags=0)=0
folly::Range< const char * >
folly::ImmediateFileWriter::writeMessage
void writeMessage(folly::StringPiece buffer, uint32_t flags=0) override
Definition:
ImmediateFileWriter.cpp:33
uint32_t
uint32_t
Definition:
ConstexprMathBenchmark.cpp:186
proxygen
folly
folly
logging
ImmediateFileWriter.h
Generated by
1.8.11