當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Trace::info方法代碼示例

本文整理匯總了PHP中Trace::info方法的典型用法代碼示例。如果您正苦於以下問題:PHP Trace::info方法的具體用法?PHP Trace::info怎麽用?PHP Trace::info使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Trace的用法示例。


在下文中一共展示了Trace::info方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: start

 public function start($setting = array())
 {
     Trace::info(str_repeat('-', 100));
     Trace::info(str_pad('[ ShadowSocks Swoole PHP ]', 100, ' ', STR_PAD_BOTH));
     Trace::info(str_pad("IP:" . self::$conf['ip'] . " PORT:" . self::$conf['port'], 100, ' ', STR_PAD_BOTH));
     Trace::info(str_pad("PassWord : " . self::$conf['passwd'], 100, ' ', STR_PAD_BOTH));
     Trace::info(str_pad("Encode :" . self::$conf['method'], 100, ' ', STR_PAD_BOTH));
     Trace::info(str_repeat('-', 100));
     $default = ['timeout' => 1, 'poll_thread_num' => 1, 'worker_num' => 4, 'backlog' => 128, 'dispatch_mode' => 2];
     $setting = array_merge($default, $setting);
     $this->serv->set($setting);
     $this->serv->start();
 }
開發者ID:jinguanio,項目名稱:shadowsocks-swoole-php,代碼行數:13,代碼來源:ShadowSocks.php

示例2: send

 public function send($data = null)
 {
     //鎖定狀態寫入隊列
     if (!empty($data)) {
         $this->queue->push($data);
     }
     if ($this->reconn) {
         Trace::debug("*********cli {$this->fd} reconn \n");
         $this->cli->connect($this->conf['ip'], $this->conf['port']);
         $this->reconn = false;
         $this->lock = true;
     }
     if ($this->queue->isEmpty()) {
         $this->lock = false;
     } elseif (!$this->lock) {
         $this->lock = true;
         $data = $this->queue->shift();
         Trace::debug("*********cli {$this->fd} send " . strlen($data) . "\n==================\n" . substr($data, 0, 50) . "...\n==============");
         Trace::info(sprintf("Host: %-25s %s", $this->conf['host'], strstr($data, "\n", true)));
         //;'Host:' . $this->conf['host'] . strstr($data, "\n", true)
         $this->cli->send($data);
     }
 }
開發者ID:jinguanio,項目名稱:shadowsocks-swoole-php,代碼行數:23,代碼來源:Client.php


注:本文中的Trace::info方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。