Convenience method for logging to the ShopgateLogger.

@param string $msg  The error message.
@param string $type The log type, that would be one of the ShopgateLogger::LOGTYPE_* constants.

@return bool True on success, false on error.
188206
public function log($msg, $type = ShopgateLogger::LOGTYPE_ERROR)
    {
        return ShopgateLogger::getInstance()->log($msg, $type);
    }
1024637
public function log($msg, $timestamp = true)
    {
        if ($timestamp) {
            $timestamp = strftime("%Y-%m-%d %H:%M:%S");
            $msg = "[{$timestamp}] {$msg}";
        }
        $this->addResult($msg);
        if ($this->verbose) echo $msg . PHP_EOL;
    }
6306
protected function do_log($message, $type='exception in code') {
		$this->debugLogs[] = array('project'=>$this->projectName,'upgradeFile'=>$this->upgradeConfigFile,'message'=>$message,'type'=>$type);
		if($this->internalUpgradeInProgress === true) {
			$this->storedLogs[] = func_get_args();
		}
		else {
			if(is_object($this->logsObj)) {
				$this->logsObj->log_by_class($message, $type);
			}
		}
	}
1226485
protected function tryLog($msg, $tries = 0)
    {
        if ((bool)@fwrite($this->stream, $msg))
            return;

        if (0 < $tries)
        {
            trigger_error(sprintf('%s - Unable to log message: "%s"', get_called_class(), $tries, $msg));
            return;
        }

        $this->attemptStreamRecovery();

        $this->tryLog($msg, ++$tries);
    }
1259864
private function shouldExecuteCallback($msg)
    {
        if ($this->pattern) {
            return (bool) preg_match($this->pattern, $msg, $this->matches);
        }

        return true;
    }
520503
protected function outputCustomFormatMessages($messages, $type)
    {
        foreach ($messages as $line => $messagesPerLine) {
            foreach ($messagesPerLine as $column => $messagesPerColumn) {
                foreach ($messagesPerColumn as $message) {
                    $msgType = $message['type'];
                    if ($type == $msgType) {
                        $logLevel = Project::MSG_INFO;
                        if ($msgType == 'ERROR') {
                            $logLevel = Project::MSG_ERR;
                        } else {
                            if ($msgType == 'WARNING') {
                                $logLevel = Project::MSG_WARN;
                            }
                        }
                        $text = $message['message'];
                        $string = $msgType . ' in line ' . $line . ' column ' . $column . ': ' . $text;
                        $this->log($string, $logLevel);
                    }
                }
            }
        }
    }
1008946
public function abort($msg = null, $type = null)
	{
		$retval = true;
		$step = array_pop($this->stepStack);

		// Raise abort warning
		if ($msg)
		{
			$this->log(LogLevel::WARNING, $msg);
		}

		while ($step != null)
		{
			switch ($step['type'])
			{
				case 'file':
					// Remove the file
					$stepval = File::delete($step['path']);
					break;

				case 'folder':
					// Remove the folder
					$stepval = File::delete($step['path']);
					break;

				default:
					$stepval = false;
					break;
			}

			// Only set the return value if it is false
			if ($stepval === false)
			{
				$retval = false;
			}

			// Get the next step and continue
			$step = array_pop($this->stepStack);
		}

		$debug = Config::get()->get('debug');

		if ($debug) {
			throw new RuntimeException('Installation unexpectedly terminated: ' . $msg, 500);
		}
		return $retval;
	}
1038215
def log(type, message)
      case type.to_sym
      when :info
        msg = message
      when :error
        msg = message
      end

      @messages << msg
      puts msg if verbose?
    end
1015595
protected function simpleCommand($type, $msgid = 0)
    {
        $msgobj = $this->getMessageObject($type);

        if ($msgid) {
            $msgobj->setMsgID($msgid);
        }

        return $this->message_write($msgobj);
    }
985796
protected function logUncaughtErrors($type)
    {
        $this->logErrorTypes |= $type;

        $unhandled = E_ERROR | E_PARSE | E_CORE_ERROR | E_COMPILE_ERROR;

        if ($type & ~$unhandled) {
            $this->initErrorHandler();
        }

        if ($type & $unhandled) {
            $this->initShutdownFunction();
        }
    }
124628
private function log($msg)
    {
        $logger = $this->getConfig('logger');
        if (!$logger) return false;
        return call_user_func_array($logger, array($msg));
    }
618827
public static function validate($msg, $type){
    $userId = !empty($msg["userId"]);
    $anonId = !empty($msg["anonymousId"]);
    self::assert($userId || $anonId, "Segment::${type}() requires userId or anonymousId");
  }
593321
public function log($message,$type="error",$prefix="err")
    {
        //msg
        $msg="time:".(string)date("Y-m-d H:i:s")."\r\n";
        $msg.="type:".$type."\r\n";
        $msg.="addr:".$_SERVER["REMOTE_ADDR"]."\r\n";
        $msg.="uri:".$_SERVER["REQUEST_URI"]."\r\n";
        $msg.="desc:".$message;
        $msg.="\r\n------------------------------------------------------------------------------------\r\n";

        //path
        $path=$this->getLogDir();
        $fn=Path::combinePath($path,str_replace(" ","_",$prefix)."_".(string)date("Ymd").".log");
        $fp=@fopen($fn,"ab");
        @fwrite($fp,$msg);
        @fclose($fp);
    }
206272
public static function log($msg)
    {
        $msg = $msg . "\n";
        if (!self::$daemonize) {
            self::safeEcho($msg);
        }
        file_put_contents((string)self::$logFile, date('Y-m-d H:i:s') . ' ' . 'pid:' . getmypid() . ' ' . $msg, FILE_APPEND | LOCK_EX);
    }
320727
protected function log($msg, $priority = Propel::LOG_INFO)
    {
        return Propel::log(get_class($this) . ': ' . $msg, $priority);
    }
135273
public function flash($msg, $type = 'info', $params = null)
    {
        $this->startSession();
        if (is_array($type)) {
            $params = $type;
            $type = 'info';
        }
        if (!isset($_SESSION['__flashes'])) {
            $_SESSION['__flashes'] = array($type => array());
        } elseif (!isset($_SESSION['__flashes'][$type])) {
            $_SESSION['__flashes'][$type] = array();
        }
        $_SESSION['__flashes'][$type][] = $this->markdown($msg, $params);
    }
833027
private static function createLogger($type) {
        $Logger = new Logger($type);

        foreach (Config::getInstance()->get('logger', 'handlers') as $handlerType => $handlerConfig) {
            $Handler = static::createHandler($handlerType, $handlerConfig);
            if (!$Handler) {
                continue;
            }
            $Handler->setFormatter(static::createLogFormatter($handlerConfig));
            $Logger->pushHandler($Handler);
        }

        $Logger->pushProcessor(new GlobalContextProcessor());
        return $Logger;
    }