FC++  v0.9.0-9e9b65
FileCatalyst Fast File Transfers - C++ Library
fc::SummaryLog Namespace Reference

The SummaryLog namespace contains helper functions for generating a summary of what happens within FC++. More...

Functions

std::string getLogFilename ()
 Get the name of the file used to record a summary of what FC++ runs durring a session. More...
 
bool truncateLogFile ()
 Truncate the summary log file, or create it if it didn't already exist. More...
 
bool removeLogFile ()
 Remove the summary log file. More...
 
void add (const std::string &msg)
 Add a message to the summary log file. More...
 

Detailed Description

The SummaryLog namespace contains helper functions for generating a summary of what happens within FC++.

These functions may be called directly, or via the log wrapper in fc::Logging.

A typical summary log looks like this:

2016-05-16 17:06:41 EDT 9054:9054 downloading 1.00 KiB: ./test.txt
2016-05-16 17:06:41 EDT 9054:9054 >> REST 0
2016-05-16 17:06:41 EDT 9054:9054 << 350 Restart position accepted (0).
2016-05-16 17:06:41 EDT 9054:9054 >> RETR "/test.txt" 583771335
2016-05-16 17:06:41 EDT 9054:9054 << 150 Sending data for e.txt (1025 bytes). Sending from port 8096
2016-05-16 17:06:42 EDT 9054:9054 >> RBACK -1
2016-05-16 17:06:43 EDT 9054:9054 << 226 Transfer complete.
2016-05-16 17:06:43 EDT 9054:9054 >> MD5 "/test.txt"
2016-05-16 17:06:44 EDT 9054:9054 << 213 AE187E1FEBEE2A150B64849C32D566CA
2016-05-16 17:06:44 EDT 9054:9054 download statistics for /test.txt <- ./test.txt
ACK packets received: 1
Average transfer rate: 31.06 Kbps
Block size: 1.00 KiB
Blocks completed: 1
Bytes expected: 1.00 KiB
Bytes transferred: 1.00 KiB
...
See also
fc::Logging::EType::kSummary
fc::Logging::enable()

Function Documentation

◆ getLogFilename()

std::string fc::SummaryLog::getLogFilename ( )

Get the name of the file used to record a summary of what FC++ runs durring a session.

This can change depending on fc::Options::setLogFileOutputDir(). If this file doesn't exist, then a summary wont be recorded.

See also
fc::SummaryLog::removeLogFile()
fc::Logging::get_filename()
fc::Logging::EType::kSummary

References FC_SUMMARY_FILENAME, fc::Name::full(), fc::Options::getLogFileOutputDir(), and fc::Name::isRelative().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ truncateLogFile()

bool fc::SummaryLog::truncateLogFile ( )

Truncate the summary log file, or create it if it didn't already exist.

See also
fc::Logging::enable()
fc::Logging::EType::kSummary

References add(), getLogFilename(), fc::libfcBitSize(), fc::libfcVersionStr(), and summary_logging_enabled.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ removeLogFile()

bool fc::SummaryLog::removeLogFile ( )

Remove the summary log file.

Returns
TRUE if the file was removed, or if it didn't exist.
FALSE if the file cannot be removed. E.g., read-only filesystem, or permission issues.
See also
fc::Logging::disable()
fc::Logging::EType::kSummary

References getLogFilename(), and summary_logging_enabled.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ add()

void fc::SummaryLog::add ( const std::string &  msg)

Add a message to the summary log file.

This will automatically prepend the date, time, and TID to the message.

References getLogFilename(), and summary_logging_enabled.

Here is the call graph for this function:
Here is the caller graph for this function:
fc::Kbps
uint64_t Kbps(const int rate)
Convert easy-to-use numerical values to bps values.
Definition: FCOptions.hpp:268