Compare commits
1 Commits
efc90d8bfe
...
ba8211e0da
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ba8211e0da |
16
smart.cmake
16
smart.cmake
@@ -31,7 +31,21 @@ do( '@MARS_NWE_INSTALL_FULL_CONFDIR@/smart.conf' )
|
||||
or die "Could not load @MARS_NWE_INSTALL_FULL_CONFDIR@/smart.conf: $@ $!";
|
||||
|
||||
close( STDERR );
|
||||
open( STDERR, '>>' . $smart_log_path )
|
||||
|
||||
# Prefix all raw STDERR from helper tools with timestamp/component before it
|
||||
# reaches smart.log. This also catches output from nwbols/nwbpset/nwpasswd
|
||||
# and systemctl warnings.
|
||||
my $smart_stderr_filter = "perl -MPOSIX=strftime -ne 'chomp; " .
|
||||
"my \\$v=\\$ENV{SMART_VERSION}||q{0.99.pl28}; " .
|
||||
"my \\$f=\\$ENV{SMART_LOG_FILE}||q{stderr}; " .
|
||||
"print strftime(q{[%Y-%m-%d %H:%M:%S]}, localtime), qq{ [ERROR] [SMArT \\$v] [\\$f] \\$_\\n};' >> " .
|
||||
quotemeta( $smart_log_path );
|
||||
|
||||
$ENV{SMART_VERSION} = defined( $smart_version ) && $smart_version ne '' ? $smart_version : '0.99.pl28';
|
||||
$ENV{SMART_LOG_FILE} = 'stderr';
|
||||
|
||||
open( STDERR, '|-', $smart_stderr_filter )
|
||||
or open( STDERR, '>>' . $smart_log_path )
|
||||
or die "Could not open $smart_log_path: $!";
|
||||
|
||||
$ENV{HOME} = '@MARS_NWE_INSTALL_FULL_CONFDIR@';
|
||||
|
||||
Reference in New Issue
Block a user