peek: with --verbose, show Data name and Nack reason
Closes: https://github.com/named-data/ndn-tools/pull/2
Change-Id: I70fa2dd164caa9cbf986b0931c38c360a8d1b6ed
diff --git a/tools/peek/ndnpeek/ndnpeek.cpp b/tools/peek/ndnpeek/ndnpeek.cpp
index 23833f1..c371882 100644
--- a/tools/peek/ndnpeek/ndnpeek.cpp
+++ b/tools/peek/ndnpeek/ndnpeek.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2018, Regents of the University of California,
+ * Copyright (c) 2014-2019, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -91,9 +91,9 @@
m_resultCode = ResultCode::DATA;
if (m_options.isVerbose) {
- std::cerr << "DATA, RTT: "
+ std::cerr << "DATA: " << data.getName() << "\nRTT: "
<< time::duration_cast<time::milliseconds>(time::steady_clock::now() - m_expressInterestTime).count()
- << "ms" << std::endl;
+ << " ms" << std::endl;
}
if (m_options.wantPayloadOnly) {
@@ -113,9 +113,9 @@
lp::NackHeader header = nack.getHeader();
if (m_options.isVerbose) {
- std::cerr << "NACK, RTT: "
+ std::cerr << "NACK: " << header.getReason() << "\nRTT: "
<< time::duration_cast<time::milliseconds>(time::steady_clock::now() - m_expressInterestTime).count()
- << "ms" << std::endl;
+ << " ms" << std::endl;
}
if (m_options.wantPayloadOnly) {