Skip to content
Snippets Groups Projects

Remove log file

Merged John Swinbank requested to merge tickets/102 into master
1 unresolved thread

The log is covered by .gitignore, but it was added before .gitignore was created so it continued to be versioned. When we remove it, .gitignore should ensure it isn't recreated.

Addresses esap-general#102 (closed).

Edited by John Swinbank

Merge request reports

Checking pipeline status.

Approved by

Merged by Nico VermaasNico Vermaas 3 years ago (Feb 24, 2022 1:19pm UTC)

Merge details

  • Changes merged into master with 39e03d8f.
  • Deleted the source branch.

Pipeline #25610 passed

Pipeline passed for 39e03d8f on master

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
132 132 # https://docs.djangoproject.com/en/1.11/topics/logging/#configuring-logging
133 133 # The default configuration: https://github.com/django/django/blob/stable/1.11.x/django/utils/log.py
134 134
135 # Ensure that the output directory for the log file exists;
136 # it won't be created automatically.
137 LOG_FILE_NAME = os.path.join(BASE_DIR, "../logs/esap.log")
  • Is the '../' really needed?

  • Well, sorta. Because of the way BASE_DIR is defined, it is necessary to say “go up a level then into logs” in order for the logs to land in the same place as they are now.

    We could also do that with something like

    LOG_FILE_NAME = os.path.join(os.path.dirname(BASE_DIR), "logs/esap.log")

    but that looks even uglier to me.

    The other option is just to use a relative path, but I guess that makes the location of the log dependent on the directory the user happens to be in when they start things up, which seems less than great.

    So in short: I think this is a big ugly but the best compromise. But if it makes you really unhappy, let me know and I'll do something else! :-)

  • It does not make me unhappy haha. That's why I also approved it. Just merely the question like 'do we have to go up one level' and you answered it :smile:

  • ...it made me unhappy. But I couldn't think of a better option. :-)

  • Please register or sign in to reply
  • Fanna Lautenbach approved this merge request

    approved this merge request

  • Nico Vermaas mentioned in commit 39e03d8f

    mentioned in commit 39e03d8f

  • merged

  • Please register or sign in to reply
    Loading