
Research
/Security News
10 npm Typosquatted Packages Deploy Multi-Stage Credential Harvester
Socket researchers found 10 typosquatted npm packages that auto-run on install, show fake CAPTCHAs, fingerprint by IP, and deploy a credential stealer.
@loongsuite/cms_logs
Advanced tools
CMS Logs 是 CMS 可观测性 SDK 的日志能力包。目前提供基础的日志功能探测,为未来的日志管线实现预留接口。这是可观测性三大支柱(追踪、指标、日志)中日志部分的实现基础。
# 使用 anpm (推荐)
anpm add @loongsuite/cms_logs
# 或使用 npm
npm install @loongsuite/cms_logs
目前主要提供日志功能的可用性检测:
import { info } from '@loongsuite/cms_logs';
// 检测日志功能是否可用
const status = info();
console.log(status); // 输出: 'cms_logs ready'
import {
info,
// 未来可能添加的导出
Logger,
LogRecord,
LogRecordProcessor,
LogExporter
} from '@loongsuite/cms_logs';
import { info } from '@loongsuite/cms_logs';
// 检查日志功能状态
const logStatus = info();
console.log('Log functionality status:', logStatus);
// 在应用启动时检查
if (logStatus === 'cms_logs ready') {
console.log('Logging system is ready');
} else {
console.warn('Logging system is not available');
}
import { NodeSDK } from '@loongsuite/cms_node_sdk';
import { info } from '@loongsuite/cms_logs';
const sdk = new NodeSDK({
serviceName: 'my-service'
});
// 启动前检查日志功能
const logStatus = info();
console.log('Log status before SDK start:', logStatus);
sdk.start();
// 启动后再次检查
const postStartStatus = info();
console.log('Log status after SDK start:', postStartStatus);
import { info } from '@loongsuite/cms_logs';
class ApplicationLogger {
private isLoggingAvailable: boolean;
constructor() {
this.isLoggingAvailable = info() === 'cms_logs ready';
}
log(level: string, message: string, attributes?: Record<string, any>) {
if (this.isLoggingAvailable) {
// 使用 CMS 日志系统
this.logWithCMS(level, message, attributes);
} else {
// 降级到控制台输出
console.log(`[${level}] ${message}`, attributes);
}
}
private logWithCMS(level: string, message: string, attributes?: Record<string, any>) {
// 未来实现 CMS 日志记录
console.log(`[CMS-${level}] ${message}`, attributes);
}
}
// 使用示例
const logger = new ApplicationLogger();
logger.log('INFO', 'Application started', { version: '1.0.0' });
logger.log('ERROR', 'Database connection failed', { error: 'timeout' });
// 未来可能的 API 设计
import {
Logger,
LogRecord,
BatchLogProcessor,
ConsoleLogExporter
} from '@loongsuite/cms_logs';
// 创建日志记录器
const logger = new Logger('my-service', '1.0.0');
// 记录日志
logger.info('User login successful', {
'user.id': '12345',
'user.email': 'user@example.com',
'login.method': 'password'
});
logger.error('Database connection failed', {
'db.host': 'localhost',
'db.port': 5432,
'error.message': 'Connection timeout'
});
// 配置日志处理器
const logProcessor = new BatchLogProcessor(
new ConsoleLogExporter(),
{ scheduledDelayMillis: 1000 }
);
import { info } from '@loongsuite/cms_logs';
import { NodeSDK } from '@loongsuite/cms_node_sdk';
const sdk = new NodeSDK({
serviceName: 'my-service'
});
sdk.start();
// 在追踪上下文中记录日志状态
const tracer = sdk.getTracerManager().getTracer('my-service');
const span = tracer.startSpan('log-check');
span.setAttributes({
'log.status': info(),
'log.available': info() === 'cms_logs ready'
});
span.end();
// 未来可能的集成方式
import { Logger } from '@loongsuite/cms_logs';
import { NodeSDK } from '@loongsuite/cms_node_sdk';
const sdk = new NodeSDK({
serviceName: 'my-service'
});
sdk.start();
// 自动关联追踪上下文
const logger = new Logger('my-service', '1.0.0');
// 日志会自动包含当前 span 信息
logger.info('Processing request', {
'http.method': 'GET',
'http.url': '/api/users'
});
import { info } from '@loongsuite/cms_logs';
class LoggingMonitor {
private checkInterval: NodeJS.Timeout;
start() {
// 定期检查日志功能状态
this.checkInterval = setInterval(() => {
const status = info();
if (status !== 'cms_logs ready') {
console.warn('Logging system status changed:', status);
}
}, 30000); // 每30秒检查一次
}
stop() {
if (this.checkInterval) {
clearInterval(this.checkInterval);
}
}
}
import { info } from '@loongsuite/cms_logs';
// 详细的状态检查
function checkLoggingStatus() {
const status = info();
console.log('Logging status check:', {
status,
timestamp: new Date().toISOString(),
nodeVersion: process.version,
environment: process.env.NODE_ENV
});
return status === 'cms_logs ready';
}
// 在关键点检查状态
checkLoggingStatus();
@loongsuite/cms_core: 核心类型和接口定义(未来可能)MIT License
FAQs
## 简介
We found that @loongsuite/cms_logs demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers 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.

Research
/Security News
Socket researchers found 10 typosquatted npm packages that auto-run on install, show fake CAPTCHAs, fingerprint by IP, and deploy a credential stealer.

Product
Socket Firewall Enterprise is now available with flexible deployment, configurable policies, and expanded language support.

Security News
Open source dashboard CNAPulse tracks CVE Numbering Authorities’ publishing activity, highlighting trends and transparency across the CVE ecosystem.