Skip to content

Commit

Permalink
feat(example): implement logger::on_connected()
Browse files Browse the repository at this point in the history
  • Loading branch information
deniskovalchuk committed Sep 23, 2023
1 parent ae41fbe commit bf3dc28
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions example/logger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ namespace

/*
* Save logs in the following format:
* -- Connected to localhost on port 2121.
* <- 220 FTP server is ready.
* -> USER user
* <- 331 Username ok, send password.
Expand All @@ -56,6 +57,11 @@ class logger : public ftp::observer
}

private:
void on_connected(std::string_view hostname, std::uint16_t port) override
{
log_file_ << "-- Connected to " << hostname << " on port " << port << "." << std::endl;
}

void on_request(std::string_view command) override
{
log_file_ << "-> ";
Expand Down

0 comments on commit bf3dc28

Please sign in to comment.