summaryrefslogtreecommitdiff
path: root/src/file/mail.cpp
diff options
context:
space:
mode:
authoreportnov <eportnov@ibs.ru>2022-09-14 10:37:58 +0300
committereportnov <eportnov@ibs.ru>2022-09-14 10:37:58 +0300
commit8a0b56e2fc3f5c0ec71ca79e4c64e34bea29c043 (patch)
treeafdfb3dc5d418566f4564494cbe77449899d2b74 /src/file/mail.cpp
parenta78e04585b2d4097a88ab681c1beebe8fe9586a1 (diff)
downloadobmc-sila-smtp-8a0b56e2fc3f5c0ec71ca79e4c64e34bea29c043.tar.xz
add logger
Diffstat (limited to 'src/file/mail.cpp')
-rw-r--r--src/file/mail.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/file/mail.cpp b/src/file/mail.cpp
index 1516880..96d760b 100644
--- a/src/file/mail.cpp
+++ b/src/file/mail.cpp
@@ -1,6 +1,7 @@
#include <fstream>
#include "mail.hpp"
+#include "managment/logger.hpp"
namespace smtp::file
{
@@ -14,8 +15,8 @@ namespace smtp::file
std::ifstream mail_file{ mPathFile, std::fstream::in };
if ( !mail_file.is_open() )
{
- //TODO new file
- // std::cerr << "Failed to open pcie_devices database \n";
+ manage::Logger::LogError( "Unable to open file to read " + mPathFile );
+ return {};
}
std::string line{};
manage::MailsSet result;
@@ -37,8 +38,7 @@ namespace smtp::file
std::ofstream mail_file{ mPathFile, std::fstream::out | std::fstream::trunc };
if ( !mail_file.is_open() )
{
- //TODO new file
- // std::cerr << "Failed to open pcie_devices database \n";
+ manage::Logger::LogError( "Unable to open file to write " + mPathFile );
return false;
}
for( const auto& pair : data )