Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
FSL
conda
installer
Commits
5053300c
Commit
5053300c
authored
Aug 03, 2021
by
Paul McCarthy
🚵
Browse files
MNT: Use a unique file name for log file
parent
a0b3d36b
Changes
1
Hide whitespace changes
Inline
Side-by-side
fslinstaller.py
View file @
5053300c
...
...
@@ -1713,12 +1713,19 @@ def parse_args(argv=None):
def
config_logging
(
ctx
):
"""Configures logging. Log messages are directed to
$TMPDIR/fslinstaller.log, or workdir/fslinstaller.log
$TMPDIR/fslinstaller_<unique_token>.log, or
workdir/fslinstaller_<unique_token>.log
"""
if
ctx
.
args
.
workdir
is
not
None
:
logdir
=
ctx
.
args
.
workdir
else
:
logdir
=
tempfile
.
gettempdir
()
logfile
=
op
.
join
(
logdir
,
'fslinstaller.log'
)
# Use a unique name for the log file
# (important for multi-user systems)
logfilef
,
logfile
=
tempfile
.
mkstemp
(
prefix
=
'fslinstaller_'
,
suffix
=
'.log'
,
dir
=
logdir
)
os
.
close
(
logfilef
)
ctx
.
logfile
=
logfile
handler
=
logging
.
FileHandler
(
logfile
)
formatter
=
logging
.
Formatter
(
...
...
@@ -1791,6 +1798,7 @@ def main(argv=None):
printmsg
(
'FSL installer version:'
,
EMPHASIS
,
UNDERLINE
,
end
=
''
)
printmsg
(
' {}'
.
format
(
__version__
))
printmsg
(
'Press CTRL+C at any time to cancel installation'
,
INFO
)
printmsg
(
'Installation log file: {}
\n
'
.
format
(
ctx
.
logfile
),
INFO
)
if
args
.
listversions
:
list_available_versions
(
ctx
.
manifest
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment