Remove request logging from Drive/Feed/Syncer (prepare to move it into CurlAgent)

pull/40/head
Vitaliy Filippov 2015-09-30 13:53:53 +03:00
parent 8fd74d7a36
commit 9b8e0c826b
7 changed files with 2 additions and 34 deletions

View File

@ -1,7 +1,7 @@
cmake_minimum_required(VERSION 2.8)
# Grive version. remember to update it for every new release!
set( GRIVE_VERSION "0.4.0-pre" )
set( GRIVE_VERSION "0.4.2-pre" )
# common compile options
add_definitions( -DVERSION="${GRIVE_VERSION}" )

View File

@ -129,9 +129,6 @@ void Drive::DetectChanges()
Log( "Reading remote server file list", log::info ) ;
std::auto_ptr<Feed> feed = m_syncer->GetAll() ;
if ( m_options["log-xml"].Bool() )
feed->EnableLog( "/tmp/file", ".xml" ) ;
while ( feed->GetNext( m_syncer->Agent() ) )
{
std::for_each(
@ -144,8 +141,6 @@ void Drive::DetectChanges()
{
Log( "Detecting changes from last sync", log::info ) ;
feed = m_syncer->GetChanges( prev_stamp+1 ) ;
if ( m_options["log-xml"].Bool() )
feed->EnableLog( "/tmp/changes", ".xml" ) ;
while ( feed->GetNext( m_syncer->Agent() ) )
{
std::for_each(

View File

@ -40,12 +40,4 @@ Feed::iterator Feed::end() const
return m_entries.end() ;
}
void Feed::EnableLog( const std::string& prefix, const std::string& suffix )
{
m_log.reset( new LogInfo ) ;
m_log->prefix = prefix ;
m_log->suffix = suffix ;
m_log->sequence = 0 ;
}
} // end of namespace gr::v1

View File

@ -43,16 +43,8 @@ public :
virtual bool GetNext( http::Agent *http ) = 0 ;
iterator begin() const ;
iterator end() const ;
virtual void EnableLog( const std::string& prefix, const std::string& suffix ) ;
protected :
struct LogInfo
{
std::string prefix ;
std::string suffix ;
std::size_t sequence ;
} ;
std::auto_ptr<LogInfo> m_log ;
Entries m_entries ;
std::string m_next ;
} ;

View File

@ -24,7 +24,6 @@
#include "http/Agent.hh"
#include "http/Header.hh"
#include "http/ResponseLog.hh"
#include "http/XmlResponse.hh"
#include "xml/NodeSet.hh"
@ -42,18 +41,11 @@ Feed1::Feed1( const std::string &url ):
bool Feed1::GetNext( http::Agent *http )
{
http::XmlResponse xrsp ;
http::ResponseLog log( &xrsp ) ;
if ( m_next.empty() )
return false;
if ( m_log.get() != 0 )
log.Reset(
m_log->prefix,
(boost::format( "-#%1%%2%" ) % m_log->sequence++ % m_log->suffix ).str(),
&xrsp ) ;
http->Get( m_next, &log, http::Header() ) ;
http->Get( m_next, &xrsp, http::Header() ) ;
xml::Node m_root = xrsp.Response() ;
xml::NodeSet xe = m_root["entry"] ;

View File

@ -25,7 +25,6 @@
#include "http/Agent.hh"
#include "http/Header.hh"
//#include "http/ResponseLog.hh"
#include "http/StringResponse.hh"
#include "http/XmlResponse.hh"
@ -123,7 +122,6 @@ bool Syncer1::Create( Resource *res )
hdr.Add( "Content-Type: application/atom+xml" ) ;
http::XmlResponse xml ;
// http::ResponseLog log( "create", ".xml", &xml ) ;
m_http->Post( uri, meta, &xml, hdr ) ;
AssignIDs( res, Entry1( xml.Response() ) ) ;

View File

@ -27,7 +27,6 @@
#include "http/Download.hh"
#include "http/Header.hh"
#include "http/StringResponse.hh"
//#include "http/ResponseLog.hh"
#include "json/ValResponse.hh"
#include "json/JsonWriter.hh"