return true;
}
- GlobalLogger.info() << "Resolved IP(s) for host : " << HostDnsAddress << endl;
+ GlobalLogger.info() << "Trying to resolve IP(s) for host : " << HostDnsAddress << endl;
try
{
}
catch ( const boost::system::system_error & /*ex*/ )
{
- GlobalLogger.info() << "Host is not an IP: " << HostDnsAddress << endl;
+ GlobalLogger.debug() << "Host is not an IP: " << HostDnsAddress << endl;
}
return false;
#include "icmp/icmpechorequestmessage.h"
#include "icmp/icmpgenericmessage.h"
+#include <logfunc.hpp>
+using I2n::Logger::GlobalLogger;
+
using namespace std;
using boost::shared_ptr;
break;
case Icmpv4Type_InvalidLast:
default:
+ GlobalLogger.error() << "Invalid ICMPv4 message type " << static_cast<int>(type) << "!";
BOOST_ASSERT( !"Try to set an invalid ICMPv4 message type" );
break;
}
// and stores in the buffer object
(void) header.Payload.read( is );
- if ( header.get_version() != 4 )
+ uint8_t header_version = header.get_version();
+ if ( header_version != 4 )
{
- GlobalLogger.error() << "Error: invalid IP header version." << endl;
+ GlobalLogger.error() << "Error: invalid IP header version: " << static_cast<int>(header_version) << endl;
is.setstate( ios::failbit );
+ return is;
}
// read the consecutive N bytes (for options field) from the input stream
static_cast<streamsize>( Ipv4HeaderSizeInBytes );
if ( ( options_length < 0 ) || ( 40 < options_length ) )
{
- GlobalLogger.error() << "Error: invalid IP options length value." << endl;
+ GlobalLogger.error() << "Error: invalid IP options length value:" << options_length << endl;
is.setstate( ios::failbit );
}
else if ( ( 0 < options_length ) && ( options_length <= 40 ) )
{
int log_level = configuration->get_log_level();
I2n::Logger::set_log_level( log_level ); //lint !e534
+ GlobalLogger.info() << "Set LogLevel to " << I2n::Logger::level_string() << endl;
set_log_output( configuration );