mirror of
https://github.com/miurahr/aqtinstall.git
synced 2025-12-18 05:04:38 +03:00
Add logging argument options
Signed-off-by: Hiroshi Miura <miurahr@linux.com>
This commit is contained in:
@@ -21,12 +21,12 @@
|
||||
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
import functools
|
||||
import logging
|
||||
import os
|
||||
import py7zr
|
||||
import requests
|
||||
import traceback
|
||||
import xml.etree.ElementTree as ElementTree
|
||||
from logging import getLogger
|
||||
from six import StringIO
|
||||
from multiprocessing.dummy import Pool
|
||||
from operator import and_
|
||||
@@ -47,8 +47,13 @@ class QtInstaller:
|
||||
Installer class to download packages and extract it.
|
||||
"""
|
||||
|
||||
def __init__(self, qt_archives):
|
||||
def __init__(self, qt_archives, logging=None):
|
||||
self.qt_archives = qt_archives
|
||||
if logging:
|
||||
self.logger = logging
|
||||
else:
|
||||
self.logger = getLogger('aqt')
|
||||
|
||||
|
||||
@staticmethod
|
||||
def retrieve_archive(package, path=None, command=None):
|
||||
@@ -126,7 +131,7 @@ class QtInstaller:
|
||||
print("Configuration file generation error: %s" % e.args)
|
||||
exc_buffer = StringIO()
|
||||
traceback.print_exc(file=exc_buffer)
|
||||
logging.error('Error happened when writing configuration files:\n%s', exc_buffer.getvalue())
|
||||
self.logger.error('Error happened when writing configuration files:\n%s', exc_buffer.getvalue())
|
||||
raise e
|
||||
else:
|
||||
exit(1)
|
||||
|
||||
Reference in New Issue
Block a user