Skip to content

Commit

Permalink
添加设置url 的 配置
Browse files Browse the repository at this point in the history
  • Loading branch information
yangjian168 committed Jan 24, 2022
1 parent 472d56b commit 5329fa6
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/Inspector.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ class Inspector
'enable' => true,
'max_items' => 100,
'env' => 'test',
'url' => '',
'single' => true,
];

Expand All @@ -28,6 +29,11 @@ public function __construct()
$configuration = new Configuration($this->options['key']);
$configuration->setEnabled($this->options['enable']);
$configuration->setMaxItems($this->options['max_items']);
if($this->options['url']){
$configuration->setUrl($this->options['url']);
}
$configuration->setTransport('curl');
// trace($configuration);
$ins = new InspectorOrignal($configuration);
$this->ins = $ins;

Expand Down Expand Up @@ -103,4 +109,12 @@ public function end($type, $duration = null){
return $ret;
}
}

public static function log($message){
$file = ini_get('error_log');
if(!is_string($message)){
$message = json_encode($message, JSON_UNESCAPED_UNICODE);
}
return file_put_contents($file, $message.PHP_EOL, FILE_APPEND);
}
}

0 comments on commit 5329fa6

Please sign in to comment.