mirror of
https://github.com/QwenLM/qwen-code.git
synced 2025-12-20 08:47:44 +00:00
A couple of these log messages were now showing up every time on app startup (#1335)
This commit is contained in:
@@ -83,7 +83,9 @@ export class ClearcutLogger {
|
|||||||
}
|
}
|
||||||
|
|
||||||
flushToClearcut(): Promise<LogResponse> {
|
flushToClearcut(): Promise<LogResponse> {
|
||||||
|
if (this.config?.getDebugMode()) {
|
||||||
console.log('Flushing log events to Clearcut.');
|
console.log('Flushing log events to Clearcut.');
|
||||||
|
}
|
||||||
return new Promise<Buffer>((resolve, reject) => {
|
return new Promise<Buffer>((resolve, reject) => {
|
||||||
const request = [
|
const request = [
|
||||||
{
|
{
|
||||||
@@ -93,7 +95,9 @@ export class ClearcutLogger {
|
|||||||
},
|
},
|
||||||
];
|
];
|
||||||
const body = JSON.stringify(request);
|
const body = JSON.stringify(request);
|
||||||
|
if (this.config?.getDebugMode()) {
|
||||||
console.log('Clearcut POST request body:', body);
|
console.log('Clearcut POST request body:', body);
|
||||||
|
}
|
||||||
const options = {
|
const options = {
|
||||||
hostname: 'play.googleapis.com',
|
hostname: 'play.googleapis.com',
|
||||||
path: '/log',
|
path: '/log',
|
||||||
@@ -108,7 +112,9 @@ export class ClearcutLogger {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
req.on('error', (e) => {
|
req.on('error', (e) => {
|
||||||
|
if (this.config?.getDebugMode()) {
|
||||||
console.log('Clearcut POST request error: ', e);
|
console.log('Clearcut POST request error: ', e);
|
||||||
|
}
|
||||||
reject(e);
|
reject(e);
|
||||||
});
|
});
|
||||||
req.end(body);
|
req.end(body);
|
||||||
@@ -159,7 +165,9 @@ export class ClearcutLogger {
|
|||||||
const returnVal = {
|
const returnVal = {
|
||||||
nextRequestWaitMs: Number(ms),
|
nextRequestWaitMs: Number(ms),
|
||||||
};
|
};
|
||||||
|
if (this.config?.getDebugMode()) {
|
||||||
console.log('Clearcut response: ', returnVal);
|
console.log('Clearcut response: ', returnVal);
|
||||||
|
}
|
||||||
return returnVal;
|
return returnVal;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user