npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@tianyk/ilog

v1.0.4-alpha.4

Published

Log

Downloads

6

Readme

课中日志上报

API

constructor
method

使用示例

ILog.set('uid', 1000);
ILog.set('cid', 100000);

var logger = new ILog('test');
logger.trace('trace');
logger.debug('debug');
logger.info('info');
logger.warn('warn');
logger.error('error');
logger.fatal('error');

logger.info('My name is %s, I\'m %d years old', 'Ming', 10);
logger.info('My name is %s, I\'m %d years old. %j', 'Ming', 10, { name: 'ming' });

var logger2 = new ILog('test2');
logger2.trace('trace');
logger2.debug('debug');
logger2.info('info');
logger2.warn('warn');
logger2.error('error');
logger2.fatal('error');

logger.info({ name: 'ming' });
logger.trackEvent('eventName', { payload: 'payload' });

表设计

| 字段 | 必选 | 类型及范围 | 说明 | | ----- | ----- | -------- | ---------- | | guid | true | string | 设备ID | | host | true | string | 域名 | | referer | true | string | http header referer | | ip | true | string | ip | | ua | true | string | ua | | device | true | string | 设备 | | os | true | string | 操作系统 | | netType | false | string | 网络 | | uid | true | number | 配置值 | | cid | true | number | 教室ID | | textbookId | true | number | 教材ID | | textbookVersion | true | number | 教材版本 | | role | true | string | 用户角色 | | namespace | true | string | 日志命名空间 | | timestamp | true | string | 日志发生时间 | | level | true | string | 日志级别 | | eventName | false | string | 事件名 trackEvent | | payload | false | string|object | 消息载体 |

API

收集日志

GET /api/collect

是否需要登录

true

请求参数

| 参数名 | 必选 | 类型及范围 | 说明 | | ------ | ----- | ---------- | ---------- | | +namespace | true | string | 配置key | | +level | true | string | 日志级别 | | +eventName | false | string | 事件类型。取值范围查看| | +timestamp | true | number | 日志发生时间。 |

level取值

TRACE DEBUG INFO WARN ERROR FATAL LOG_LEVELS.set(TRACK_EVENT, 6);

返回结果