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

libcoreso_demo

v2.0.0

Published

对齐 C++ 日志打印规范,方便查看对应日志。

Downloads

1

Readme

Node online 日志库

对齐 C++ 日志打印规范,方便查看对应日志。

安装

tnpm install @tencent/wx-node-onlinelog --save

使用

# import 语法,二选一
import nodelog from "@tencent/wx-node-onlinelog";

# requre 语法,二选一
const nodelog = require("@tencent/wx-node-onlinelog");


// 模板方法
let res = nodelog.OpenLogFull("mmbizdendiwu", 16425, 3,"/home/qspace/log",true, true);

if(res == 0){
    // 注册成功
    nodelog.LogInfo("hello world")
    nodelog.LogErr("hello world")
    nodelog.LogDebug("hello world")
}

模板方法参数说明:

int OpenLogFull(const char *sModuleName, const int id,
                const int iLogLevel, const char *sPath,
                bool bIsAttachModuleInfoShm, bool bIsOpenNetLog);
  • sModuleName: 当前项目的模块名,比如 mmbizwxadevdoc
  • id: CMDB 的 id,找运维负责人询问,也可以随便写一个,不重要
  • iLogLevel: 默认为 3
  • sPath: 日志打印的路径名
  • bIsAttachModuleInfoShm: 是否搭在对应的模块下,统一写 true
  • bIsOpenNetLog: 开启网络日志,统一写 true

实际打印日志如下:

<3> <ossattragent(24243,24304,0,0,0)> 16:15:11 268 [soacallgraphapi.cpp:ReportSoaCallGraph:178]	need_report_edge_info_size <= 0
<2> <connagent(39579,39585)> 16:15:11 273 ERROR:micromsg/connagent/skfsm.cpp:OnTimeout:2277 timeout m_iState 5
<2> <connagent(39579,39585)> 16:15:11 273 Error:micromsg/connagent/sknetwork.cpp:Process:1205: Svrkit STATE_FSM_ERROR == iRet
<3> <ossattragent(24243,24304,0,0,0)> 16:15:11 288 [soacallgraphapi.cpp:ReportSoaCallGraph:178]	need_report_edge_info_size <= 0
<3> <ossattragent(24243,24304,0,0,0)> 16:15:11 288 [soacallgraphapi.cpp:ReportSoaCallGraph:178]	need_report_edge_info_size <= 0
<3> <ossattragent(24228,81789,0,0,0)> 16:15:11 303 debug: SvrkitClientCallWrap zone 0 uin 0 ip 10.57.150.160 17001 ret 0 headret 0
<3> <ossattragent(24243,24304,0,0,0)> 16:15:11 308 [soacallgraphapi.cpp:ReportSoaCallGraph:178]	need_report_edge_info_size <= 0

node_boilerplate 接入文档

该库已经接入 node_boilerplate/@core 中,只需要下载 wx-node-onlinelog 包即可。

# 更新 core 
cd node/@core
git pull origin master

# 下载 npm 包
tnpm install @tencent/wx-node-onlinelog --save

线上日志查询

详情参考:https://git.code.oa.com/wxg-td/netlog/wikis/mmlog%E6%97%A5%E5%BF%97%E6%9F%A5%E8%AF%A2%E5%B7%A5%E5%85%B7