承接 roublez/logsnag-php 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

roublez/logsnag-php

最新稳定版本:2.0.0

Composer 安装命令:

composer require roublez/logsnag-php

包简介

A PHP SDK for the LogSnag API

README 文档

README

LogSnag PHP

A PHP SDK for the LogSnag API – logsnag.com

Installation

composer require hallewood/logsnag-php

Usage

Initialize Client

use Hallewood\LogSnag\Client;

$logsnag = new Client('7f568d735724351757637b1dbf108e5', 'my-project');

The project name will be auto-injected in all requests.

Log

//
// The channel and the event name are the only required parameters.
$logsnag->log('subscriptions', 'User subscribed!');

//
// Other parameters can be added when needed.
$logsnag->log(
    channel: 'subscriptions',
    event: 'User subscribed!',
    userId: '123-456',
    description: 'A new user subscribed to the **premium plan**.',
    icon: '👍🏼',
    notify: true,
    tags: [
        'payment-method': 'card',
        'plan': 'monthly',
    ],
    parser: 'markdown',
    timestamp: 1709842921,
);

Identify

//
// Both the user id and the properties are required.
$logsnag->identify(
    userId: '123-456',
    properties: [
        'active': 'yes',
        'signed-in': 'no',
    ],
);

Insight

//
// The title and the value are the only required parameters.
$logsnag->insight('Subscribed Users', 12);

//
// Other parameters can be added when needed.
$logsnag->log(
    title: 'Status',
    value: 'watered',
    icon: '🪴',
);

Insight Mutate

//
// The title and at least one mutation is required.
$logsnag->insight('Subscribed Users', inc: 3);

//
// Other parameters can be added when needed.
$logsnag->log(
    title: 'Subscribed Users',
    inc: -2,
    icon: '👍🏼',
);

统计信息

  • 总下载量: 1.62k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 2
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 2
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-08-16