mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-06 07:11:13 +02:00
Use logging config to set destination of copyright info
This commit is contained in:
1 parent
23686215fe
commit
91fba4aca4
3 files changed
+20
-25
No files matched your search
+14
-14
@@ -97,25 +97,25 @@ def main():
|
||||
raise SystemExit
|
||||
|
||||
current_year = datetime.date.today().year
|
||||
if options.quiet:
|
||||
log.info("GNS3 server version {}".format(__version__))
|
||||
log.info("Copyright (c) 2007-{} GNS3 Technologies Inc.".format(current_year))
|
||||
else:
|
||||
print("GNS3 server version {}".format(__version__))
|
||||
print("Copyright (c) 2007-{} GNS3 Technologies Inc.".format(current_year))
|
||||
|
||||
user_log = logging.getLogger('user_facing')
|
||||
if not options.quiet:
|
||||
# Send user facing messages to stdout.
|
||||
stream_handler = logging.StreamHandler(sys.stdout)
|
||||
stream_handler.addFilter(logging.Filter(name='user_facing'))
|
||||
user_log.addHandler(stream_handler)
|
||||
user_log.propagate = False
|
||||
|
||||
user_log.info("GNS3 server version {}".format(__version__))
|
||||
user_log.info("Copyright (c) 2007-{} GNS3 Technologies Inc.".format(current_year))
|
||||
|
||||
# we only support Python 3 version >= 3.3
|
||||
if sys.version_info < (3, 3):
|
||||
raise RuntimeError("Python 3.3 or higher is required")
|
||||
|
||||
if options.quiet:
|
||||
log.info("Running with Python {major}.{minor}.{micro} and has PID {pid}".format(
|
||||
major=sys.version_info[0], minor=sys.version_info[1],
|
||||
micro=sys.version_info[2], pid=os.getpid()))
|
||||
else:
|
||||
print("Running with Python {major}.{minor}.{micro} and has PID {pid}".format(
|
||||
major=sys.version_info[0], minor=sys.version_info[1],
|
||||
micro=sys.version_info[2], pid=os.getpid()))
|
||||
user_log.info("Running with Python {major}.{minor}.{micro} and has PID {pid}".format(
|
||||
major=sys.version_info[0], minor=sys.version_info[1],
|
||||
micro=sys.version_info[2], pid=os.getpid()))
|
||||
|
||||
# check for the correct locale
|
||||
# (UNIX/Linux only)
|
||||
|
||||
Reference in new issue
Block a user