From f7a87789ab0a81cf95aae386ff5c1dd5001f09fe Mon Sep 17 00:00:00 2001 From: James Turner Date: Sun, 30 Sep 2012 16:44:22 +0100 Subject: [PATCH] Improve decode_bin output slightly. --- simgear/io/decode_binobj.cxx | 4 ++++ simgear/io/sg_binobj.cxx | 5 +++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/simgear/io/decode_binobj.cxx b/simgear/io/decode_binobj.cxx index 0c4a9922..41880e12 100644 --- a/simgear/io/decode_binobj.cxx +++ b/simgear/io/decode_binobj.cxx @@ -13,6 +13,7 @@ #include #include "sg_binobj.hxx" +#include using std::cout; using std::endl; @@ -25,6 +26,9 @@ int main( int argc, char **argv ) { if ( argc != 2 ) { cout << "Usage: " << argv[0] << " binary_obj_file" << endl; } + + + sglog().setLogLevels( SG_ALL, SG_ALERT ); SGBinObject obj; bool result = obj.read_bin( argv[1] ); diff --git a/simgear/io/sg_binobj.cxx b/simgear/io/sg_binobj.cxx index f5111640..3deaacc1 100644 --- a/simgear/io/sg_binobj.cxx +++ b/simgear/io/sg_binobj.cxx @@ -423,10 +423,11 @@ bool SGBinObject::read_bin( const string& file ) { } else { // close the file before we return gzclose(fp); - + SG_LOG( SG_EVENT, SG_ALERT, + "ERROR: " << file << "has bad header"); return false; } - + // read creation time unsigned int foo_calendar_time; sgReadUInt( fp, &foo_calendar_time ); -- 2.39.5