~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/trace.py

  • Committer: Andrew Starr-Bochicchio
  • Date: 2014-03-30 17:59:29 UTC
  • mto: This revision was merged to the branch mainline in revision 6592.
  • Revision ID: a.starr.b@gmail.com-20140330175929-rd97jstcbau2j1gy
Use LooseVersion from distutils to check Cython version in order to handle non-integers in the version string.

Show diffs side-by-side

added added

removed removed

Lines of Context:
45
45
form.
46
46
"""
47
47
 
 
48
from __future__ import absolute_import
 
49
 
48
50
# FIXME: Unfortunately it turns out that python's logging module
49
51
# is quite expensive, even when the message is not printed by any handlers.
50
52
# We should perhaps change back to just simply doing it here.
192
194
 
193
195
 
194
196
def _get_bzr_log_filename():
195
 
    bzr_log = os.environ.get('BZR_LOG')
 
197
    bzr_log = osutils.path_from_environ('BZR_LOG')
196
198
    if bzr_log:
197
199
        return bzr_log
198
 
    home = os.environ.get('BZR_HOME')
 
200
    home = osutils.path_from_environ('BZR_HOME')
199
201
    if home is None:
200
 
        if sys.platform == 'win32':
201
 
            from bzrlib import win32utils
202
 
            home = win32utils.get_home_location()
203
 
        else:
204
 
            home = os.path.expanduser('~')
 
202
        # GZ 2012-02-01: Logging to the home dir is bad, but XDG is unclear
 
203
        #                over what would be better. On windows, bug 240550
 
204
        #                suggests LOCALAPPDATA be used instead.
 
205
        home = osutils._get_home_dir()
205
206
    return os.path.join(home, '.bzr.log')
206
207
 
207
208