Skip to content

Commit 7345bf3

Browse files
authored
fix(SimpleFileChannel): unify default "flush" to be false as it is in "FileChannel" (#4591) (#4622)
1 parent 4099780 commit 7345bf3

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

Foundation/include/Poco/SimpleFileChannel.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ class Foundation_API SimpleFileChannel: public Channel
7070
/// The flush property specifies whether each log message is flushed
7171
/// immediately to the log file (which may hurt application performance,
7272
/// but ensures that everything is in the log in case of a system crash),
73-
// or whether it's allowed to stay in the system's file buffer for some time.
73+
/// or whether it's allowed to stay in the system's file buffer for some time.
7474
/// Valid values are:
7575
///
7676
/// * true: Every message is immediately flushed to the log file (default).
@@ -86,16 +86,16 @@ class Foundation_API SimpleFileChannel: public Channel
8686
SimpleFileChannel(const std::string& path);
8787
/// Creates the FileChannel for a file with the given path.
8888

89-
void open();
89+
void open() override;
9090
/// Opens the FileChannel and creates the log file if necessary.
9191

92-
void close();
92+
void close() override;
9393
/// Closes the FileChannel.
9494

95-
void log(const Message& msg);
95+
void log(const Message& msg) override;
9696
/// Logs the given message to the file.
9797

98-
void setProperty(const std::string& name, const std::string& value);
98+
void setProperty(const std::string& name, const std::string& value) override;
9999
/// Sets the property with the given name.
100100
///
101101
/// The following properties are supported:
@@ -107,7 +107,7 @@ class Foundation_API SimpleFileChannel: public Channel
107107
/// flushed to the log file. See the SimpleFileChannel
108108
/// class for details.
109109

110-
std::string getProperty(const std::string& name) const;
110+
std::string getProperty(const std::string& name) const override;
111111
/// Returns the value of the property with the given name.
112112
/// See setProperty() for a description of the supported
113113
/// properties.
@@ -130,7 +130,7 @@ class Foundation_API SimpleFileChannel: public Channel
130130
static const std::string PROP_FLUSH;
131131

132132
protected:
133-
~SimpleFileChannel();
133+
~SimpleFileChannel() override;
134134
void setRotation(const std::string& rotation);
135135
void setFlush(const std::string& flush);
136136
void rotate();

Foundation/src/SimpleFileChannel.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ const std::string SimpleFileChannel::PROP_FLUSH = "flush";
3232

3333
SimpleFileChannel::SimpleFileChannel():
3434
_limit(0),
35-
_flush(true),
36-
_pFile(0)
35+
_flush(false),
36+
_pFile(nullptr)
3737
{
3838
}
3939

@@ -42,8 +42,8 @@ SimpleFileChannel::SimpleFileChannel(const std::string& path):
4242
_path(path),
4343
_secondaryPath(path + ".0"),
4444
_limit(0),
45-
_flush(true),
46-
_pFile(0)
45+
_flush(false),
46+
_pFile(nullptr)
4747
{
4848
}
4949

@@ -86,7 +86,7 @@ void SimpleFileChannel::close()
8686
FastMutex::ScopedLock lock(_mutex);
8787

8888
delete _pFile;
89-
_pFile = 0;
89+
_pFile = nullptr;
9090
}
9191

9292

@@ -134,7 +134,7 @@ std::string SimpleFileChannel::getProperty(const std::string& name) const
134134
else if (name == PROP_ROTATION)
135135
return _rotation;
136136
else if (name == PROP_FLUSH)
137-
return std::string(_flush ? "true" : "false");
137+
return (_flush ? "true"s : "false"s);
138138
else
139139
return Channel::getProperty(name);
140140
}

0 commit comments

Comments
 (0)