allow multiple message arguments and add version info
This commit is contained in:
parent
7e2ef01818
commit
1314693ab0
|
@ -6,3 +6,6 @@ https://git.barkshark.xyz/izaliamae/izzylib
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
assert sys.version_info >= (3, 6)
|
assert sys.version_info >= (3, 6)
|
||||||
|
|
||||||
|
|
||||||
|
__version__ = (0, 1, 1)
|
||||||
|
|
|
@ -79,7 +79,7 @@ class Log():
|
||||||
stdout.flush()
|
stdout.flush()
|
||||||
|
|
||||||
|
|
||||||
def log(self, level, msg):
|
def log(self, level, *msg):
|
||||||
'''log to the console'''
|
'''log to the console'''
|
||||||
levelNum = self._lvlCheck(level)
|
levelNum = self._lvlCheck(level)
|
||||||
|
|
||||||
|
@ -91,7 +91,8 @@ class Log():
|
||||||
if levelNum < self.config['level']:
|
if levelNum < self.config['level']:
|
||||||
return
|
return
|
||||||
|
|
||||||
output = f'{level}: {msg}\n'
|
message = ' '.join(msg)
|
||||||
|
output = f'{level}: {message}\n'
|
||||||
|
|
||||||
if self.config['date'] and (self.config['systemd'] and not env.get('INVOCATION_ID')):
|
if self.config['date'] and (self.config['systemd'] and not env.get('INVOCATION_ID')):
|
||||||
'''only show date when not running in systemd and date var is True'''
|
'''only show date when not running in systemd and date var is True'''
|
||||||
|
@ -102,26 +103,26 @@ class Log():
|
||||||
stdout.flush()
|
stdout.flush()
|
||||||
|
|
||||||
|
|
||||||
def critical(self, msg):
|
def critical(self, *msg):
|
||||||
self.log('CRIT', msg)
|
self.log('CRIT', *msg)
|
||||||
|
|
||||||
def error(self, msg):
|
def error(self, *msg):
|
||||||
self.log('ERROR', msg)
|
self.log('ERROR', *msg)
|
||||||
|
|
||||||
def warning(self, msg):
|
def warning(self, *msg):
|
||||||
self.log('WARN', msg)
|
self.log('WARN', *msg)
|
||||||
|
|
||||||
def info(self, msg):
|
def info(self, *msg):
|
||||||
self.log('INFO', msg)
|
self.log('INFO', *msg)
|
||||||
|
|
||||||
def verbose(self, msg):
|
def verbose(self, *msg):
|
||||||
self.log('VERB', msg)
|
self.log('VERB', *msg)
|
||||||
|
|
||||||
def debug(self, msg):
|
def debug(self, *msg):
|
||||||
self.log('DEBUG', msg)
|
self.log('DEBUG', *msg)
|
||||||
|
|
||||||
def merp(self, msg):
|
def merp(self, *msg):
|
||||||
self.log('MERP', msg)
|
self.log('MERP', *msg)
|
||||||
|
|
||||||
|
|
||||||
def getLogger(loginst, config=None):
|
def getLogger(loginst, config=None):
|
||||||
|
|
9
setup.py
9
setup.py
|
@ -2,10 +2,15 @@
|
||||||
from setuptools import setup
|
from setuptools import setup
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
|
from IzzyLib import __version__ as v
|
||||||
|
|
||||||
|
|
||||||
|
version = '.'.join([str(i) for i in v])
|
||||||
|
|
||||||
|
|
||||||
setup(
|
setup(
|
||||||
name="IzzyLib",
|
name="IzzyLib",
|
||||||
version='0.1',
|
version=version,
|
||||||
packages=['IzzyLib'],
|
packages=['IzzyLib'],
|
||||||
python_requires='>=3.6.0',
|
python_requires='>=3.6.0',
|
||||||
install_requires=[req.replace('\n', '') for req in open('requirements.txt').readlines()],
|
install_requires=[req.replace('\n', '') for req in open('requirements.txt').readlines()],
|
||||||
|
@ -13,7 +18,7 @@ setup(
|
||||||
author='Zoey Mae',
|
author='Zoey Mae',
|
||||||
author_email='admin@barkshark.xyz',
|
author_email='admin@barkshark.xyz',
|
||||||
description='a collection of often-used functions and classes',
|
description='a collection of often-used functions and classes',
|
||||||
keywords='web http server',
|
keywords='web http server database postgresql',
|
||||||
url='https://git.barkshark.xyz/izaliamae/izzylib',
|
url='https://git.barkshark.xyz/izaliamae/izzylib',
|
||||||
project_urls={
|
project_urls={
|
||||||
'Bug Tracker': 'https://git.barkshark.xyz/izaliamae/izzylib/issues',
|
'Bug Tracker': 'https://git.barkshark.xyz/izaliamae/izzylib/issues',
|
||||||
|
|
Loading…
Reference in a new issue