Summary
- Added option to write logger to file
- Either using a keyword argument
python
from softnanotools.logger import Logger
logger = Logger(__name__, logfile='test.log')
- Alternatively using an environment variable
bash
$ export LOGFILE=test.log
python
from softnanotools.logger import Logger
logger = Logger(__name__)
- Or finally use a custom environment variable
bash
$ export CUSTOM_LOGFILE=test.log
python
import os
from softnanotools.logger import Logger
logger = Logger(__name__, logfile=os.environ.get('CUSTOM_LOGFILE', 'test.log'))