|
|
@@ -57,12 +57,12 @@ std::shared_ptr<appender> file_appender::create(properties const & props) {
|
|
|
}
|
|
|
|
|
|
static std::ios_base::openmode mode(bool append) {
|
|
|
- return append ? std::ios_base::app : 0;
|
|
|
+ return append ? std::ios_base::app : std::ios_base::out;
|
|
|
}
|
|
|
|
|
|
buffer::buffer(properties const & props) : std::filebuf() {
|
|
|
if (open(props["filename"], mode(props["fileAppend"])) == nullptr) {
|
|
|
- // TODO: throw
|
|
|
+ throw std::runtime_error("Cannot open file");
|
|
|
}
|
|
|
}
|
|
|
|