devserver: make host event logging optional

This is to prevent clogging the devserver's memory when this feature is
not needed (normally in specific test situations, where it will be
invoked with the new --host_log flag).

BUG=None
TEST=Passes unit tests; host events logged when requested

Change-Id: I3fe078dfdcd87abcdf2fa0886d814dc4a37a8c84
Reviewed-on: https://gerrit.chromium.org/gerrit/34660
Reviewed-by: Chris Sosa <sosa@chromium.org>
Commit-Ready: Gilad Arnold <garnold@chromium.org>
Tested-by: Gilad Arnold <garnold@chromium.org>
diff --git a/devserver.py b/devserver.py
index 93d725c..711611b 100755
--- a/devserver.py
+++ b/devserver.py
@@ -621,6 +621,9 @@
   parser.add_option('--for_vm',
                     dest='vm', action='store_true',
                     help='update is for a vm image')
+  parser.add_option('--host_log',
+                    action='store_true', default=False,
+                    help='record history of host update events (/api/hostlog)')
   parser.add_option('--image',
                     metavar='FILE',
                     help='force update using this image')
@@ -732,6 +735,7 @@
       critical_update=options.critical_update,
       remote_payload=options.remote_payload,
       max_updates=options.max_updates,
+      host_log=options.host_log,
   )
 
   # Sanity-check for use of validate_factory_config.