~santi73/encuentro/py3

« back to all changes in this revision

Viewing changes to encuentro/logger.py

  • Committer: Santiago Torres Batan
  • Date: 2018-12-23 23:12:00 UTC
  • Revision ID: santi73@gmail.com-20181223231200-h811b3b0zy2xw44i
- Encuentro python3 port.
- Functional but still need some work.
- Depends on https://code.launchpad.net/~santi73/encuentro/qt5/+merge/360976 to be merge to trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
#
15
15
# For further info, check  https://launchpad.net/encuentro
16
16
 
17
 
from __future__ import print_function
18
 
 
19
17
"""Logging set up."""
20
18
 
21
19
import logging
25
23
 
26
24
from logging.handlers import RotatingFileHandler
27
25
 
28
 
import xdg.BaseDirectory
29
 
 
 
26
import xdg
30
27
 
31
28
class CustomRotatingFH(RotatingFileHandler):
32
29
    """Rotating handler that starts a new file for every run."""
49
46
 
50
47
def get_filename():
51
48
    """Return the log file name."""
52
 
    return os.path.join(xdg.BaseDirectory.xdg_cache_home,
 
49
    return os.path.join(xdg.XDG_CACHE_HOME,
53
50
                        'encuentro', 'encuentro.log')
54
51
 
55
52