summaryrefslogtreecommitdiff
path: root/src/file/mail.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/file/mail.cpp')
-rw-r--r--src/file/mail.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/file/mail.cpp b/src/file/mail.cpp
index cf5fe26..2a2231b 100644
--- a/src/file/mail.cpp
+++ b/src/file/mail.cpp
@@ -13,10 +13,12 @@ namespace smtp::file
manage::MailsSet Mail::Read() const
{
+ static const std::string METHOD_NAME = "Read mails";
+
std::ifstream mail_file{ mPathFile, std::fstream::in };
if ( !mail_file.is_open() )
{
- manage::Logger::LogError( "Unable to open file to read " + mPathFile );
+ logger::LoggerSet::GetInstance()->LogError( METHOD_NAME, "Unable to open file to read " + mPathFile );
return {};
}
std::string line{};
@@ -35,10 +37,12 @@ namespace smtp::file
bool Mail::Write( manage::MailsSet const& data ) const
{
+ static const std::string METHOD_NAME = "Write mails";
+
std::ofstream mail_file{ mPathFile, std::fstream::out | std::fstream::trunc };
if ( !mail_file.is_open() )
{
- manage::Logger::LogError( "Unable to open file to write " + mPathFile );
+ logger::LoggerSet::GetInstance()->LogError( METHOD_NAME, "Unable to open file to write " + mPathFile );
return false;
}
for( const auto& mail : data )