当前位置: 首页>>代码示例>>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;未经允许,请勿转载。