summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKostyantyn Ovechko <fastinetserver@gmail.com>2010-07-28 14:02:57 +0300
committerKostyantyn Ovechko <fastinetserver@gmail.com>2010-07-28 14:02:57 +0300
commit4ff3b34839c52ff6bd4e3ee65f3e48c2a2cd9237 (patch)
treec9ad6a7788a562d8fee6066793a56f50223042cc /segget/connection.cpp
parentShow network_type in tui. (diff)
downloadidfetch-4ff3b34839c52ff6bd4e3ee65f3e48c2a2cd9237.tar.gz
idfetch-4ff3b34839c52ff6bd4e3ee65f3e48c2a2cd9237.tar.bz2
idfetch-4ff3b34839c52ff6bd4e3ee65f3e48c2a2cd9237.zip
Add options: GENERAL_LOG_TIME_FORMAT, ERROR_LOG_TIME_FORMAT and DEBUG_LOG_TIME_FORMAT to segget.conf file
GENERAL_LOG_TIME_FORMAT Set time format for general log as a string containing any combination of regular characters and special format specifiers. These format specifiers are replaced by the function to the corresponding values to represent the time specified in timeptr. They all begin with a percentage (%) sign, and are: %a Abbreviated weekday name [For example: Thu] %A Full weekday name [For example: Thursday] %b Abbreviated month name [For example: Aug] %B Full month name [For example: August] %c Date and time representation [For example: Thu Aug 23 14:55:02 2001] %d Day of the month (01-31) [For example: 23] %H Hour in 24h format (00-23) [For example: 14] %I Hour in 12h format (01-12) [For example: 02] %j Day of the year (001-366) [For example: 235] %m Month as a decimal number (01-12) [For example: 08] %M Minute (00-59) [For example: 55] %p AM or PM designation [For example: PM] %S Second (00-61) [For example: 02] %U Week number with the first Sunday as the first day of week one (00-53) [For example: 33] %w Weekday as a decimal number with Sunday as 0 (0-6) [For example: 4] %W Week number with the first Monday as the first day of week one (00-53) [For example: 34] %x Date representation [For example: 08/23/01] %X Time representation [For example: 14:55:02] %y Year, last two digits (00-99) [For example: 01] %Y Year [For example: 2001] %Z Timezone name or abbreviation [For example: CDT] %% A % sign [For example: %] For instace general_log_time_format=Time: %m/%d %X Default: general_log_time_format=%m/%d %X ERROR_LOG_TIME_FORMAT Set time format for error log as a string containing any combination of regular characters and special format specifiers. See GENERAL_LOG_TIME_FORMAT for details on format specifiers. Default: error_log_time_format=%m/%d %X DEBUG_LOG_TIME_FORMAT Set time format for debug log as a string containing any combination of regular characters and special format specifiers. See GENERAL_LOG_TIME_FORMAT for details on format specifiers. Default: debug_log_time_format=%m/%d %X
Diffstat (limited to 'segget/connection.cpp')
-rw-r--r--segget/connection.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/segget/connection.cpp b/segget/connection.cpp
index 02993b6..9380cf4 100644
--- a/segget/connection.cpp
+++ b/segget/connection.cpp
@@ -207,10 +207,10 @@ void Tconnection::show_connection_progress(ulong time_diff){
ulong speed=(bytes_per_last_interval*1000)/time_diff;
ulong avg_speed=(total_dld_bytes*1000)/time_left_from(start_time);
string eta_string;
- if (speed==0){
+ if (avg_speed==0){
eta_string=" ETA: inf";
}else{
- eta_string=" ETA: "+secsToString((segment->segment_size-segment->downloaded_bytes)/speed);
+ eta_string=" ETA: "+secsToString((segment->segment_size-segment->downloaded_bytes)/avg_speed);
}
string speed_str;
string avg_speed_str;