Its arguments are a client session id, the status filename and the
database filename.
-** Draft **
+== LogParser.py ==
-* At this point, there is no database interraction (DatabaseWriter.py
-function call is commented out).
-* Sample call:
+libtorrent verbose log files parser. Receives a verbose log file as argument.
+Basename must have ${IP_ADDRESS}_${LISTEN_PORT}.log syntax.
----
-razvan@valhalla:~/projects/p2p-next/cs-p2p-next/log-parser/libtorrent$ PYTHONPATH=../../auto/db/ python StatusParser.py -i 2 -f ../../log-samples/libtorrent/libtorrent-status.sample.log ../../auto/db/p2p-next.db
----
+The parser recognizes the message types as defined in the BitTorrent
+specification[1].
-* Some debug output messages can be enabled by initializing the DEBUG
-global variable in the StatusParser.py to True.
+== sample run ==
+
+In order to see the above modules at work, use the run_sample script. Just
+use a simple command
+ ./run_sample
+
+Check the script to see the calling syntax for the above modules. The sample
+files are locate in ../../log-samples/libtorrent/
+[1] http://wiki.theory.org/BitTorrentSpecification
#!/bin/bash
-PYTHONPATH=../../auto/db/ python StatusParser.py -i 2 -f ../../log-samples/libtorrent/libtorrent-status.sample.log ../../auto/db/p2p-next.db
+DB_NAME=test.db
+
+# remove database in case it exists
+rm -f $DB_NAME
+
+# create database
+pushd . &> /dev/null
+cd ../../auto/db && ./db_init ../../log-parser/libtorrent/$DB_NAME
+popd &> /dev/null
+
+# fill database with test data
+PYTHONPATH=../../auto/db/ python ../../auto/db/DatabaseAccess.py $DB_NAME
+
+# fill status information
+PYTHONPATH=../../auto/db/ python StatusParser.py -i 1 -f ../../log-samples/libtorrent/libtorrent-status.sample.log $DB_NAME
+
+# fill logging information
+PYTHONPATH=../../auto/db/ python LogParser.py -i 1 -f ../../log-samples/libtorrent/141.85.224.222_50200.log $DB_NAME