]> git.mxchange.org Git - simgear.git/commitdiff
Improve decode_bin output slightly.
authorJames Turner <zakalawe@mac.com>
Sun, 30 Sep 2012 15:44:22 +0000 (16:44 +0100)
committerJames Turner <zakalawe@mac.com>
Sun, 30 Sep 2012 15:44:22 +0000 (16:44 +0100)
simgear/io/decode_binobj.cxx
simgear/io/sg_binobj.cxx

index 0c4a99226841cb3655200bca76bfc6b2e884382d..41880e1257a80c839a43911207835c47a4f0ff3a 100644 (file)
@@ -13,6 +13,7 @@
 #include <cstdio>
 
 #include "sg_binobj.hxx"
+#include <simgear/debug/logstream.hxx>
 
 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] );
index f511164064fc5f0d3bafb39ce71e548baa50da3a..3deaacc19972348f51d884b90ee6ab1ce663e383 100644 (file)
@@ -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 );