diff --git a/grive/src/main.cc b/grive/src/main.cc index e38b0f6..aa713c2 100644 --- a/grive/src/main.cc +++ b/grive/src/main.cc @@ -130,13 +130,14 @@ int Main( int argc, char **argv ) // log grive version to log file file_log->Log( log::Fmt("grive version " VERSION " " __DATE__ " " __TIME__), log::verbose ) ; + file_log->Log( log::Fmt("current time: %1%") % DateTime::Now(), log::verbose ) ; comp_log->Add( file_log ) ; } if ( vm.count( "version" ) ) { std::cout - << "grive version " VERSION " " __DATE__ " " __TIME__ << std::endl ; + << "grive version " << VERSION << ' ' << __DATE__ << ' ' << __TIME__ << std::endl ; return 0 ; } if ( vm.count( "verbose" ) ) diff --git a/libgrive/src/drive/Drive.cc b/libgrive/src/drive/Drive.cc index 5fd43f8..1b13d93 100644 --- a/libgrive/src/drive/Drive.cc +++ b/libgrive/src/drive/Drive.cc @@ -66,13 +66,12 @@ Drive::Drive( OAuth2& auth, const Json& options ) : http::CurlAgent http ; long prev_stamp = m_state.ChangeStamp() ; - Trace( "previous time stamp is %1%", prev_stamp ) ; + Trace( "previous change stamp is %1%", prev_stamp ) ; // get metadata http::XmlResponse xrsp ; // http::ResponseLog log( "meta-", ".xml", &xrsp ) ; http.Get( "https://docs.google.com/feeds/metadata/default", &xrsp, m_http_hdr ) ; - Trace( "return %1%", xrsp.Response()["docs:largestChangestamp"] ) ; m_state.ChangeStamp( std::atoi(xrsp.Response()["docs:largestChangestamp"]["@value"].front().Value().c_str()) ) ; diff --git a/libgrive/src/drive/Resource.cc b/libgrive/src/drive/Resource.cc index 1df51cf..a4e8501 100644 --- a/libgrive/src/drive/Resource.cc +++ b/libgrive/src/drive/Resource.cc @@ -502,8 +502,10 @@ void Resource::Download( http::Agent* http, const fs::path& file, const http::He long r = http->Get( m_content, &dl, auth ) ; if ( r <= 400 ) { - assert( m_mtime != DateTime() ) ; - os::SetFileTime( file, m_mtime ) ; + if ( m_mtime != DateTime() ) + os::SetFileTime( file, m_mtime ) ; + else + Log( "encountered zero date time after downloading %1%", file, log::warning ) ; } }