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
323a5b52
Commit
323a5b52
authored
Aug 03, 2021
by
Paul McCarthy
🚵
Browse files
Merge branch 'rf/logfilename' into 'master'
Use unique file name for log file See merge request fsl/conda/installer!13
parents
a0b3d36b
cc54f8b3
Changes
1
Hide whitespace changes
Inline
Side-by-side
fslinstaller.py
View file @
323a5b52
...
...
@@ -52,7 +52,7 @@ log = logging.getLogger(__name__)
__absfile__
=
op
.
abspath
(
__file__
).
rstrip
(
'c'
)
__version__
=
'1.
0.15
'
__version__
=
'1.
1.0
'
"""Installer script version number. This is automatically updated
whenever a new version of the installer script is released.
"""
...
...
@@ -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
Markdown
is supported
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