/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to breezy/trace.py

  • Committer: Jelmer Vernooij
  • Date: 2020-02-13 23:57:28 UTC
  • mfrom: (7490 work)
  • mto: This revision was merged to the branch mainline in revision 7492.
  • Revision ID: jelmer@jelmer.uk-20200213235728-m6ds0mm3mbs4y182
Merge trunk.

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.
201
203
    :return: A path to the log file
202
204
    :raise EnvironmentError: If the cache directory could not be created
203
205
    """
204
 
    brz_log = os.environ.get('BRZ_LOG')
 
206
    brz_log = osutils.path_from_environ('BRZ_LOG')
205
207
    if brz_log:
206
208
        return brz_log
207
209
    return os.path.join(bedding.cache_dir(), 'brz.log')
509
511
    elif not getattr(exc_object, 'internal_error', True):
510
512
        report_user_error(exc_info, err_file)
511
513
        return errors.EXIT_ERROR
512
 
    elif isinstance(exc_object, EnvironmentError):
 
514
    elif osutils.is_environment_error(exc_object):
513
515
        if getattr(exc_object, 'errno', None) == errno.EPIPE:
514
516
            err_file.write("brz: broken pipe\n")
515
517
            return errors.EXIT_ERROR