Menu

#32 Changes for Qt5

1.0
open
nobody
None
2024-08-09
2024-08-09
Anonymous
No

Utils.py

-------------------------------------------------------------------------------

Name: Utils

Purpose:

Author: Elbar

Created: 01/03/2012

Copyright: (c) USER 2012

Licence: <your licence=""></your>

-------------------------------------------------------------------------------

!/usr/bin/env python

from PyQt5 import QtWidgets
from logging import Formatter
from logging.handlers import RotatingFileHandler

def errorMessageBox(msg):

QtWidgets.QMessageBox.critical(None,"Error",msg,QtWidgets.QMessageBox.Ok,QtWidgets.QMessageBox.NoButton)

def set_up_logger_file(logger,file_name):

fh = RotatingFileHandler(file_name, 'a', 65536, 7)
frm = Formatter("%(asctime)s\t%(levelname)s\t%(module)s.%(funcName)s\t%(threadName)s\t%(message)s")
fh.setFormatter(frm)
logger.addHandler(fh)

Discussion

Anonymous
Anonymous

Add attachments
Cancel





Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.