109 #$logFile = getcwd."/getenv.log"; |
109 #$logFile = getcwd."/getenv.log"; |
110 $pathToReleaseFolder = undef; |
110 $pathToReleaseFolder = undef; |
111 $defaultPathToServer = undef; |
111 $defaultPathToServer = undef; |
112 $pathToUnzip = "7za"; |
112 $pathToUnzip = "7za"; |
113 $getEnvVersion = "2.4.9"; |
113 $getEnvVersion = "2.4.9"; |
114 |
114 |
115 # first open/create log file |
|
116 #open( LOGFILE, ">> $logFile" ) or handleError( "cant create log file: $!", $warning ); |
|
117 eval { |
|
118 open( LOGFILE, ">> getcwd.'/output/logs/getenv.log'" ); |
|
119 }; |
|
120 if ($@) #if exception |
|
121 { |
|
122 open( LOGFILE, ">> getcwd.'/getenv.log'" ) ; |
|
123 } |
|
124 |
|
125 print "S60 RnD environment getter v.$getEnvVersion\n\n"; |
115 print "S60 RnD environment getter v.$getEnvVersion\n\n"; |
126 printLog( "getenv.pl version $getEnvVersion" ); |
116 printLog( "getenv.pl version $getEnvVersion" ); |
127 |
117 |
128 # The actual functionality |
118 # The actual functionality |
129 if( $param_grace ) { |
119 if( $param_grace ) { |
409 my ($sec,$min,$hr) = localtime(); |
399 my ($sec,$min,$hr) = localtime(); |
410 printf( "%02d:%02d:%02d: ", $hr, $min, $sec ); |
400 printf( "%02d:%02d:%02d: ", $hr, $min, $sec ); |
411 print $trace."\n"; |
401 print $trace."\n"; |
412 } |
402 } |
413 |
403 |
|
404 # first open/create log file |
|
405 #open( LOGFILE, ">> $logFile" ) or handleError( "cant create log file: $!", $warning ); |
|
406 eval { |
|
407 open( LOGFILE, ">> getcwd.'/output/logs/getenv.log'" ); |
|
408 }; |
|
409 if ($@) #if exception |
|
410 { |
|
411 open( LOGFILE, ">> getcwd.'/getenv.log'" ) or handleError( "cant create log file: $!", $warning ); |
|
412 } |
414 # we should print traces for log file |
413 # we should print traces for log file |
415 my ($sec,$min,$hr) = localtime(); |
414 my ($sec,$min,$hr) = localtime(); |
416 printf LOGFILE ( "%02d:%02d:%02d: ", $hr, $min, $sec ); |
415 printf LOGFILE ( "%02d:%02d:%02d: ", $hr, $min, $sec ); |
417 print LOGFILE $trace."\n"; |
416 print LOGFILE $trace."\n"; |
|
417 close (LOGFILE); |
418 } |
418 } |
419 } |
419 } |
420 |
420 |
421 sub HandleError { |
421 sub HandleError { |
422 my( $errorString, $errorType ) = @_; |
422 my( $errorString, $errorType ) = @_; |