Changeset 668


Ignore:
Timestamp:
Feb 18, 2019 1:24:26 AM (5 years ago)
Author:
anonymous
Message:

Add CLI coloring method. Allow longer email logging in dev.

Location:
trunk/lib
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/App.inc.php

    r665 r668  
    17161716        }
    17171717    }
     1718
     1719    /*
     1720    *
     1721    *
     1722    * @access   public
     1723    * @param
     1724    * @return
     1725    * @author   Quinn Comendant <quinn@strangecode.com>
     1726    * @since    17 Feb 2019 13:11:20
     1727    */
     1728    public function colorCLI($color)
     1729    {
     1730        switch ($color) {
     1731        case 'white':
     1732            echo "\033[0;37m";
     1733            break;
     1734        case 'black':
     1735            echo "\033[0;30m";
     1736            break;
     1737        case 'red':
     1738            echo "\033[0;31m";
     1739            break;
     1740        case 'yellow':
     1741            echo "\033[0;33m";
     1742            break;
     1743        case 'green':
     1744            echo "\033[0;32m";
     1745            break;
     1746        case 'cyan':
     1747            echo "\033[0;36m";
     1748            break;
     1749        case 'blue':
     1750            echo "\033[0;34m";
     1751            break;
     1752        case 'purple':
     1753            echo "\033[0;35m";
     1754            break;
     1755        case 'off':
     1756        default:
     1757            echo "\033[0m";
     1758            break;
     1759        }
     1760    }
    17181761} // End.
  • trunk/lib/Email.inc.php

    r630 r668  
    423423
    424424        case self::SANDBOX_MODE_LOG:
     425            // Temporarily modify log settings to allow full multi-line emails to appear in logs.
    425426            $log_serialize = $app->getParam('log_serialize');
    426             $app->setParam(array('log_serialize' => false));
    427             $app->logMsg(sprintf("\nSubject: %s\nTo: %s\n%s\n\n%s", $this->getParam('subject'), $final_to, str_replace($this->getParam('crlf'), "\n", $final_headers), $final_body), LOG_DEBUG, __FILE__, __LINE__);
    428             $app->setParam(array('log_serialize' => $log_serialize));
     427            $log_message_max_length = $app->getParam('log_message_max_length');
     428            $app->setParam(array('log_serialize' => false, 'log_message_max_length' => 65536));
     429            $app->logMsg(sprintf("\nSubject: %s\nTo: %s\n%s\n\n%s", $this->getParam('subject'), $final_to, trim(str_replace($this->getParam('crlf'), "\n", $final_headers)), trim($final_body)), LOG_DEBUG, __FILE__, __LINE__);
     430            $app->setParam(array('log_serialize' => $log_serialize, 'log_message_max_length' => $log_message_max_length));
    429431            return true;
    430432        }
Note: See TracChangeset for help on using the changeset viewer.