Improve logging functionality
The format of timestamps is now configurable via a new
--timestamp-format option. The default format is changed
to Unix epoch time with microsecond granularity.
Co-authored-by: Davide Pesavento <davidepesa@gmail.com>
Change-Id: I7dd7fb770becca7aa339e003b1111366f34ce925
diff --git a/README.md b/README.md
index 3b77b9b..ef34ee5 100644
--- a/README.md
+++ b/README.md
@@ -29,30 +29,40 @@
### `ndn-traffic-server`
Usage: ndn-traffic-server [options] <Traffic_Configuration_File>
+
Respond to Interests as per provided Traffic_Configuration_File.
Multiple prefixes can be configured for handling.
Set the environment variable NDN_TRAFFIC_LOGFOLDER to redirect output to a log file.
+
Options:
- -h [ --help ] print this help message and exit
- -c [ --count ] arg maximum number of Interests to respond to
- -d [ --delay ] arg (=0) wait this amount of milliseconds before responding to each Interest
- -q [ --quiet ] turn off logging of Interest reception/Data generation
+ -h [ --help ] print this help message and exit
+ -c [ --count ] arg maximum number of Interests to respond to
+ -d [ --delay ] arg (=0) wait this amount of milliseconds before responding to each Interest
+ -t [ --timestamp-format ] arg format string for timestamp output (see below)
+ -q [ --quiet ] turn off logging of Interest reception and Data generation
### `ndn-traffic-client`
Usage: ndn-traffic-client [options] <Traffic_Configuration_File>
+
Generate Interest traffic as per provided Traffic_Configuration_File.
Interests are continuously generated unless a total number is specified.
Set the environment variable NDN_TRAFFIC_LOGFOLDER to redirect output to a log file.
+
Options:
-h [ --help ] print this help message and exit
-c [ --count ] arg total number of Interests to be generated
-i [ --interval ] arg (=1000) Interest generation interval in milliseconds
- -q [ --quiet ] turn off logging of Interest generation/Data reception
+ -t [ --timestamp-format ] arg format string for timestamp output (see below)
+ -q [ --quiet ] turn off logging of Interest generation and Data reception
+ -v [ --verbose ] log additional per-packet information
* These tools need not be used together and can be used individually as well.
* Please refer to the sample configuration files provided for details on how to create your own.
* Use the command line options shown above to adjust traffic configuration.
+* By default, timestamps are logged in Unix epoch format with microsecond granularity.
+ For custom output, the `--timestamp-format` option expects a format string using the syntax given in the
+ [Boost.Date_Time documentation](https://www.boost.org/doc/libs/1_71_0/doc/html/date_time/date_time_io.html#date_time.format_flags).
## Example