Example #1
0
 /**
  * Clean logs
  *
  * @return $this
  */
 public function logClean()
 {
     if (!$this->_scopeConfig->isSetFlag(self::XML_PATH_LOG_CLEAN_ENABLED, \Magento\Store\Model\ScopeInterface::SCOPE_STORE)) {
         return $this;
     }
     $this->_errors = array();
     try {
         $this->_log->clean();
     } catch (\Exception $e) {
         $this->_errors[] = $e->getMessage();
         $this->_errors[] = $e->getTrace();
     }
     $this->_sendLogCleanEmail();
     return $this;
 }
Example #2
0
 public function testClean()
 {
     $this->assertSame($this->log, $this->log->clean());
 }