
Company News
/Security News
Socket Selected for OpenAI's Cybersecurity Grant Program
Socket is an initial recipient of OpenAI's Cybersecurity Grant Program, which commits $10M in API credits to defenders securing open source software.
做这个工具是因为:
所以我做了这个工具,让测试小姐姐可以点击某个按钮,就能把日志下载下来,然后将日志附在Bug详情中。更加方便的排查问题。

yarn add log4s
import Log4s from 'log4s'
// 或者 const Log4s from 'log4s'
// 或者 直接script https://cdn.jsdelivr.net/npm/log4s@1.0.1/dist/log4s.umd.js 引入到html中
let log = new Log4s()
log4s.log('你好')
log4s.log('你好 abc')
log4s.log('你好, def')
log4s.log('你好, ahha')
log4s.log('你好,a')
log4s.search('a')
日志下载后,内容如下:
12-19 21:23:43.882 你好
12-19 21:23:43.882 你好 abc
12-19 21:23:43.882 你好, def
12-19 21:23:43.882 你好, ahha
12-19 21:23:43.882 你好,a
默认配置:
export default {
maxLines: 2500, // 最多纪录多少行日志
lineMaxChars: 2500, // 每行日志最多允许多少个字符,超出会截取
logFilename: 'log4s.log', // 下载时文件名称
lineBreak: '\n', // 下载文件时,每行日志之间的换行符
enableLog: true, // 是否启动日志记录功能
needTimestamp: true // 每行日志是否需要时间戳
}
let log = new Log4s()
FAQs
The npm package log4s receives a total of 1 weekly downloads. As such, log4s popularity was classified as not popular.
We found that log4s demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Company News
/Security News
Socket is an initial recipient of OpenAI's Cybersecurity Grant Program, which commits $10M in API credits to defenders securing open source software.

Security News
Socket CEO Feross Aboukhadijeh joins 10 Minutes or Less, a podcast by Ali Rohde, to discuss the recent surge in open source supply chain attacks.

Research
/Security News
Campaign of 108 extensions harvests identities, steals sessions, and adds backdoors to browsers, all tied to the same C2 infrastructure.