Browse Source

Modified TripalImporter logmessage function to output log messages to terminal / command line when code is executed on command line

Risharde Ramnath 4 years ago
parent
commit
dcfd25d186

+ 6 - 0
tripal/includes/TripalImporter.inc

@@ -579,6 +579,12 @@ class TripalImporter {
     // Generate a translated message.
     $tmessage = t($message, $variables);
 
+    // If running from terminal / command line, output messages to terminal
+    // We should only allow this output for command line and not web page loads
+    // since we don't want this output on webpages.
+    if (defined('STDIN')) { 
+      echo "\n" . $tmessage;
+    } 
 
     // If we have a job then pass along the messaging to the job.
     if ($this->job) {

+ 0 - 2
tripal_chado/includes/TripalImporter/GFF3Importer.inc

@@ -480,7 +480,6 @@ class GFF3Importer extends TripalImporter {
    * @see TripalImporter::run()
    */
   public function run() {
-
     $arguments = $this->arguments['run_args'];
     $this->gff_file = $this->arguments['files'][0]['file_path'];
 
@@ -578,7 +577,6 @@ class GFF3Importer extends TripalImporter {
 
     // Create the cache file for storing parsed GFF entries.
     $this->openCacheFile();
-
     // Load the GFF3.
     try {
       $this->logMessage("Step  1 of 26: Caching GFF3 file...                             ");