Implement log archiver for test cases after test cases are run.
The test case logs are archived in test_logs directory.

Change-Id: Ica1cb96ebeb784101ef171c8deb095ffeca513a7
diff --git a/src/test/utils/OnosLog.py b/src/test/utils/OnosLog.py
index f5dcb77..a5e0fa7 100644
--- a/src/test/utils/OnosLog.py
+++ b/src/test/utils/OnosLog.py
@@ -25,7 +25,7 @@
     def update_last_snapshot(cls, host, res):
         cls.last_snapshot_map[host] = res
 
-    def get_log(self, search_terms = None, exception = True):
+    def get_log(self, search_terms = None, exception = True, cache_result = True):
         """Run the command on the test host"""
         cmd = 'cat /root/onos/apache-karaf-3.0.5/data/log/karaf.log'
         st, output = self.ssh_agent.run_cmd(cmd)
@@ -56,7 +56,8 @@
             output += '\n'.join(exception_map['Exception'])
 
         #update the last snapshot
-        self.update_last_snapshot(self.ssh_agent.host, lines)
+        if cache_result is True:
+            self.update_last_snapshot(self.ssh_agent.host, lines)
         return st, output
 
     def search_log_pattern(self, pattern):