1. Andrew
  2. pyShipCommand

Commits

Andrew  committed a1b68dc

Enabled logging on the client.

  • Participants
  • Parent commits ddec70c
  • Branches master

Comments (0)

Files changed (1)

File pyshipcommand_gui/__init__.py

View file
 # SYSTEM
 from os import path
 from glob import glob
+import sys
 
 # ADDITIONAL LIBRARIES
 from twisted.internet import reactor, task
 import pygame
 from ocempgui.widgets import TwistedRenderer
 from djlib.game import GameClass
+import djlib.logger as logger
+log = logger.getLogger('pyshipcommand.gui')
 
 # PYSHIPCOMMAND
 from cscripts import ClientScriptMgr
 
 #end GUIGameClass
 
-def main():
+def main(argv=sys.argv[1:]):
+    from argparse import ArgumentParser, FileType
+
+    # Argument parsing
+    args = ArgumentParser()
+    logger.add_log_args(args)
+
+    options = args.parse_args(argv)
+    logger.set_log_options(options, 'pyshipcommand')
 
     # MAIN GAMECLASS
     game = GUIGameClass()