Log at least first non surrogate diagnostic
authorAdam Dickmeiss <adam@indexdata.dk>
Fri, 28 Sep 2012 14:03:11 +0000 (16:03 +0200)
committerAdam Dickmeiss <adam@indexdata.dk>
Fri, 28 Sep 2012 14:03:11 +0000 (16:03 +0200)
Instead of "Z_Records_multipleNSD"

src/gduutil.cpp
src/gduutil.hpp

index 8fe1ac4..61d9f92 100644 (file)
@@ -80,8 +80,7 @@ std::ostream& std::operator<<(std::ostream& os, Z_Records & rs)
             os << *(rs.u.nonSurrogateDiagnostic);
         break;
     case Z_Records_multipleNSD:
-        os << "Z_Records_multipleNSD";
-        //os << *(rs.u.multipleNonSurDiagnostics);
+        os << *(rs.u.multipleNonSurDiagnostics);
         break;
     default:
         os << "Z_Records" ;
@@ -90,6 +89,20 @@ std::ostream& std::operator<<(std::ostream& os, Z_Records & rs)
     return os;
 }
 
+std::ostream& std::operator<<(std::ostream& os, Z_DiagRecs& dr)
+{
+    if (dr.num_diagRecs >= 1)
+    {
+        os << *dr.diagRecs[0];
+    }
+    else
+    {
+        os << "multipleNSD";
+    }
+    return os;
+}
+
+
 std::ostream& std::operator<<(std::ostream& os, Z_DiagRec& dr)
 {
     switch (dr.which)
index 89a4503..5530740 100644 (file)
@@ -33,6 +33,7 @@ namespace std
     std::ostream& operator<<(std::ostream& os, Z_HTTP_Response& httpres);
     std::ostream& operator<<(std::ostream& os, Z_Records & rs);
     std::ostream& operator<<(std::ostream& os, Z_DiagRec& dr);
+    std::ostream& operator<<(std::ostream& os, Z_DiagRecs& dr);
     std::ostream& operator<<(std::ostream& os, Z_DefaultDiagFormat& ddf);
 }