mirror of
https://github.com/QwenLM/qwen-code.git
synced 2025-12-20 08:47:44 +00:00
feat: add os platform and version in log report (#1053)
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
|
||||
import { Buffer } from 'buffer';
|
||||
import * as https from 'https';
|
||||
import * as os from 'node:os';
|
||||
import { HttpsProxyAgent } from 'https-proxy-agent';
|
||||
|
||||
import type {
|
||||
@@ -45,6 +46,7 @@ import type {
|
||||
RumResourceEvent,
|
||||
RumExceptionEvent,
|
||||
RumPayload,
|
||||
RumOS,
|
||||
} from './event-types.js';
|
||||
import type { Config } from '../../config/config.js';
|
||||
import { safeJsonStringify } from '../../utils/safeJsonStringify.js';
|
||||
@@ -214,9 +216,17 @@ export class QwenLogger {
|
||||
return this.createRumEvent('exception', type, name, properties);
|
||||
}
|
||||
|
||||
private getOsMetadata(): RumOS {
|
||||
return {
|
||||
type: os.platform(),
|
||||
version: os.release(),
|
||||
};
|
||||
}
|
||||
|
||||
async createRumPayload(): Promise<RumPayload> {
|
||||
const authType = this.config?.getAuthType();
|
||||
const version = this.config?.getCliVersion() || 'unknown';
|
||||
const osMetadata = this.getOsMetadata();
|
||||
|
||||
return {
|
||||
app: {
|
||||
@@ -235,6 +245,7 @@ export class QwenLogger {
|
||||
id: this.sessionId,
|
||||
name: 'qwen-code-cli',
|
||||
},
|
||||
os: osMetadata,
|
||||
|
||||
events: this.events.toArray() as RumEvent[],
|
||||
properties: {
|
||||
|
||||
Reference in New Issue
Block a user