change fn Log to print

This commit is contained in:
Marko Oldenburg 2020-10-21 09:16:30 +02:00
parent 674e9dce8f
commit b02ce13d59
2 changed files with 9 additions and 6 deletions

View File

@ -1,2 +1,2 @@
UPD 2020-10-20_15:51:15 6126 FHEM/98_backupToStorage.pm UPD 2020-10-20_15:51:15 6126 FHEM/98_backupToStorage.pm
UPD 2020-10-21_09:05:15 16202 lib/FHEM/backupToStorage.pm UPD 2020-10-21_09:16:23 16319 lib/FHEM/backupToStorage.pm

View File

@ -346,6 +346,7 @@ sub PushToStorage {
$subprocess->{backupfile} = $backupFile; $subprocess->{backupfile} = $backupFile;
$subprocess->{fileNameAtStorage} = $fileNameAtStorage; $subprocess->{fileNameAtStorage} = $fileNameAtStorage;
$subprocess->{proto} = AttrVal( $name, 'bTS_Proto', 'https' ); $subprocess->{proto} = AttrVal( $name, 'bTS_Proto', 'https' );
$subprocess->{loglevel} = AttrVal( $name, 'verbose', 3 );
my $pid = $subprocess->run(); my $pid = $subprocess->run();
@ -417,9 +418,11 @@ sub FileUpload {
if ( $subprocess->{type} eq 'Nextcloud' ) { if ( $subprocess->{type} eq 'Nextcloud' ) {
my ($returnString,$returnCode) = ExecuteNCupload($subprocess); my ($returnString,$returnCode) = ExecuteNCupload($subprocess);
Log3( 'backupToStorage File Upload', 5, print 'backupToStorage File Upload - FileUpload Nextcloud, returnCode: '
"backupToStorage - FileUpload Nextcloud, returnCode: $returnCode . $returnCode
, returnString: $returnString" ); . ' , returnString: '
. $returnString' . "\n"
if ( $subprocess->{loglevel} > 4 );
$response->{ncUpload} = ( $returnCode == 72057594037927935 $response->{ncUpload} = ( $returnCode == 72057594037927935
&& $returnString eq '' && $returnString eq ''
@ -429,8 +432,8 @@ sub FileUpload {
my $json = eval { encode_json($response) }; my $json = eval { encode_json($response) };
if ($@) { if ($@) {
Log3( 'backupToStorage File Upload', print 'backupToStorage File Upload backupToStorage - JSON error: $@'
1, "backupToStorage - JSON error: $@" ); . "\n";
$json = '{"jsonerror":"$@"}'; $json = '{"jsonerror":"$@"}';
} }