Jason R. Coombs avatar Jason R. Coombs committed ec17812

Remove options around logging to stdout and to a file. Recommend using tools like 'supervisor' and 'tee' to route output from the server.

Comments (0)

Files changed (1)

 ERR_NICKNAMEINUSE = '433'
 ERR_NEEDMOREPARAMS = '461'
 
+log = logging.getLogger(__name__)
+
 class IRCError(Exception):
     """
     Exception thrown by IRC command handlers to notify client of a server/client error.
     parser.add_argument("--restart", dest="restart", action="store_true", default=False, help="Restart hircd")
     parser.add_argument("-a", "--address", dest="listen_address", action="store", default='127.0.0.1', help="IP to listen on")
     parser.add_argument("-p", "--port", dest="listen_port", action="store", default='6667', help="Port to listen on")
-    parser.add_argument("-l", "--log-stdout", dest="log_stdout", action="store_true", default=False, help="Also log to stdout")
     parser.add_argument("-e", "--errors", dest="errors", action="store_true", default=False, help="Do not intercept errors.")
     parser.add_argument("-f", "--foreground", dest="foreground", action="store_true", default=False, help="Do not go into daemon mode.")
     log_util.add_arguments(parser)
 
     # Paths
     configfile = os.path.join(os.path.realpath(os.path.dirname(sys.argv[0])),'hircd.ini')
-    logfile = os.path.join(os.path.realpath(os.path.dirname(sys.argv[0])),'hircd.log')
-
-    log_util.setup(
-        options,
-        format='%(asctime)s:%(levelname)s:%(message)s',
-        filename=logfile,
-        filemode='a')
 
     #
     # Handle start/stop/restart commands.
 
     logging.info("Starting hircd")
     logging.debug("configfile = %s" % (configfile))
-    logging.debug("logfile = %s" % (logfile))
-
-    if options.log_stdout:
-        console = logging.StreamHandler()
-        formatter = logging.Formatter('[%(levelname)s] %(message)s')
-        console.setFormatter(formatter)
-        console.setLevel(logging.DEBUG)
-        logging.getLogger('').addHandler(console)
-
-    if options.verbose:
-        logging.info("We're being verbose")
 
     #
     # Go into daemon mode
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.