change: log level

Signed-off-by: pakintada@gmail.com <Pakin>
This commit is contained in:
pakintada@gmail.com 2026-07-01 10:35:57 +07:00
parent 2395cddcdf
commit aa6414b1cc
6 changed files with 20 additions and 20 deletions

View file

@ -304,7 +304,7 @@ const handlers: Record<string, (payload: any) => void> = {
const content = p.content ?? p.value ?? p.payload; const content = p.content ?? p.value ?? p.payload;
const ref = p.ref ?? ''; const ref = p.ref ?? '';
console.log('[Sheet] Notify content received:', { logger.debug('[Sheet] Notify content received:', {
msg, msg,
target, target,
currentUid, currentUid,
@ -597,7 +597,7 @@ export async function handleIncomingMessages(raw: string, clientPrivateKey?: Cry
); );
let actual_message: WSMessage = JSON.parse(decrypted_string); let actual_message: WSMessage = JSON.parse(decrypted_string);
if (actual_message.type !== 'heartbeat') { if (actual_message.type !== 'heartbeat') {
// console.log(`[WS MSG] type=${actual_message.type}`, actual_message.payload); // logger.debug(`[WS MSG] type=${actual_message.type}`, actual_message.payload);
} }
handlers[actual_message.type]?.(actual_message.payload); handlers[actual_message.type]?.(actual_message.payload);
@ -605,7 +605,7 @@ export async function handleIncomingMessages(raw: string, clientPrivateKey?: Cry
} else { } else {
const msg: WSMessage = parsedMessage; const msg: WSMessage = parsedMessage;
if (msg.type !== 'heartbeat') { if (msg.type !== 'heartbeat') {
// console.log(`[WS MSG] type=${msg.type}`, msg.payload); // logger.debug(`[WS MSG] type=${msg.type}`, msg.payload);
} }
if (msg == null) { if (msg == null) {
// error response // error response

View file

@ -117,7 +117,7 @@ export async function sendMessage(
data = JSON.stringify(await WebCryptoHelper.encryptMessage(sharedKeyRes, data)); data = JSON.stringify(await WebCryptoHelper.encryptMessage(sharedKeyRes, data));
} }
// console.log('[WS Send]', { // logger.debug('[WS Send]', {
// type: logMessage.type, // type: logMessage.type,
// service: logMessage.payload?.srv_name, // service: logMessage.payload?.srv_name,
// param: logMessage.payload?.values?.param, // param: logMessage.payload?.values?.param,

View file

@ -77,9 +77,9 @@ async function requestPriceSlotOption(country: string, option: string): Promise<
stream: true, stream: true,
request_id request_id
}; };
console.log('[sheetService] Sending PriceSlot request:', values); logger.debug('[sheetService] Sending PriceSlot request:', values);
const sent = await sendCommandRequest('sheet', values); const sent = await sendCommandRequest('sheet', values);
console.log('[sheetService] PriceSlot request sent:', sent); logger.debug('[sheetService] PriceSlot request sent:', sent);
if (!sent) { if (!sent) {
priceSlotsLoading.set(false); priceSlotsLoading.set(false);
} }
@ -95,7 +95,7 @@ export async function updatePriceSlot(
slot: PriceSlot, slot: PriceSlot,
content: SheetRowUpdate[] content: SheetRowUpdate[]
): Promise<boolean> { ): Promise<boolean> {
// console.log('[sheetService] Sending PriceSlot update:', { // logger.debug('[sheetService] Sending PriceSlot update:', {
// country, // country,
// slot: slot.slot, // slot: slot.slot,
// name: slot.name, // name: slot.name,
@ -113,7 +113,7 @@ export async function updatePriceSlot(
option: `PriceSlot${slot.slot}` option: `PriceSlot${slot.slot}`
}); });
console.log('[sheetService] PriceSlot update sent:', { logger.debug('[sheetService] PriceSlot update sent:', {
country, country,
slot: slot.slot, slot: slot.slot,
sent sent
@ -127,7 +127,7 @@ export async function addPriceSlot(
slot: PriceSlot, slot: PriceSlot,
content: SheetRowCreate[] content: SheetRowCreate[]
): Promise<boolean> { ): Promise<boolean> {
console.log('[sheetService] Sending PriceSlot create:', { logger.debug('[sheetService] Sending PriceSlot create:', {
country, country,
slot: slot.slot, slot: slot.slot,
name: slot.name, name: slot.name,
@ -145,7 +145,7 @@ export async function addPriceSlot(
option: `PriceSlot${slot.slot}` option: `PriceSlot${slot.slot}`
}); });
console.log('[sheetService] PriceSlot create sent:', { logger.debug('[sheetService] PriceSlot create sent:', {
country, country,
slot: slot.slot, slot: slot.slot,
sent sent
@ -168,7 +168,7 @@ export async function addPriceSlotRows(
option: `PriceSlot${slot.slot}` option: `PriceSlot${slot.slot}`
}); });
console.log('[sheetService] PriceSlot rows add sent:', { logger.debug('[sheetService] PriceSlot rows add sent:', {
country, country,
slot: slot.slot, slot: slot.slot,
rows: content.length, rows: content.length,
@ -192,7 +192,7 @@ export async function deletePriceSlotRows(
option: `PriceSlot${slot.slot}` option: `PriceSlot${slot.slot}`
}); });
console.log('[sheetService] PriceSlot rows delete sent:', { logger.debug('[sheetService] PriceSlot rows delete sent:', {
country, country,
slot: slot.slot, slot: slot.slot,
rows: rowIds.length, rows: rowIds.length,
@ -400,7 +400,7 @@ export async function requestSheetPrice(
stream: true, stream: true,
request_id request_id
}); });
console.log('[sheetService] Sheet price request sent:', { country, request_id, sent }); logger.debug('[sheetService] Sheet price request sent:', { country, request_id, sent });
if (sent) { if (sent) {
markSheetPriceAsSent('price'); markSheetPriceAsSent('price');
@ -431,7 +431,7 @@ export async function requestAllSheetPrice(country: string, force = false): Prom
sheetPriceLoading.set(true); sheetPriceLoading.set(true);
console.log('[sheetService] Sending all sheet price request:', { country, request_id }); logger.debug('[sheetService] Sending all sheet price request:', { country, request_id });
const sent = await sendCommandRequest('sheet', { const sent = await sendCommandRequest('sheet', {
country, country,

View file

@ -213,7 +213,7 @@ function getPriceSlotItems(content: any): any[] {
} }
export function handlePriceSlotsResponse(content: any) { export function handlePriceSlotsResponse(content: any) {
console.log('[PriceSlot] Raw backend response:', { logger.debug('[PriceSlot] Raw backend response:', {
items: Array.isArray(content) ? content.length : undefined, items: Array.isArray(content) ? content.length : undefined,
keys: keys:
content && typeof content === 'object' && !Array.isArray(content) ? Object.keys(content) : [] content && typeof content === 'object' && !Array.isArray(content) ? Object.keys(content) : []
@ -246,7 +246,7 @@ export function handlePriceSlotsResponse(content: any) {
return; return;
} }
console.log('[PriceSlot] Normalized slots:', { logger.debug('[PriceSlot] Normalized slots:', {
country, country,
slots: normalizedSlots.length, slots: normalizedSlots.length,
firstSlot: normalizedSlots[0] firstSlot: normalizedSlots[0]
@ -806,7 +806,7 @@ export function handleRawStreamChunk(subtype: string, payload: any) {
targetSubtype = 'priceslot'; targetSubtype = 'priceslot';
} }
console.log( logger.debug(
`[RawStream] Chunk ${payload.idx} for ${targetSubtype}, raw length:`, `[RawStream] Chunk ${payload.idx} for ${targetSubtype}, raw length:`,
payload.raw?.length payload.raw?.length
); );
@ -857,7 +857,7 @@ export function handleRawStreamEnd(subtype: string, payload: any) {
targetSubtype = 'priceslot'; targetSubtype = 'priceslot';
} }
console.log(`[RawStream] End payload for ${targetSubtype}:`, payload); logger.debug(`[RawStream] End payload for ${targetSubtype}:`, payload);
const streamData = currentData[targetSubtype]; const streamData = currentData[targetSubtype];

View file

@ -29,7 +29,7 @@ export const POST: RequestHandler = async ({ request }) => {
`${API_BASE}/catalog/create/${encodeURIComponent(country)}/${encodeURIComponent(uid)}` + `${API_BASE}/catalog/create/${encodeURIComponent(country)}/${encodeURIComponent(uid)}` +
`/${encodeURIComponent(displayName)}/${encodeURIComponent(email)}`; `/${encodeURIComponent(displayName)}/${encodeURIComponent(email)}`;
console.log('[Catalog Create Proxy] Endpoint:', endpoint, 'slug:', slug); logger.debug('[Catalog Create Proxy] Endpoint:', endpoint, 'slug:', slug);
const upstream = new FormData(); const upstream = new FormData();
upstream.append('slug', slug); upstream.append('slug', slug);

View file

@ -43,7 +43,7 @@ export const POST: RequestHandler = async ({ request }) => {
`${API_BASE}/video/mainpage/${encodeURIComponent(uid)}` + `${API_BASE}/video/mainpage/${encodeURIComponent(uid)}` +
`/${encodeURIComponent(displayName)}/${encodeURIComponent(email)}`; `/${encodeURIComponent(displayName)}/${encodeURIComponent(email)}`;
console.log('[Video MainPage Proxy] Endpoint:', endpoint, 'name:', name); logger.debug('[Video MainPage Proxy] Endpoint:', endpoint, 'name:', name);
const upstream = new FormData(); const upstream = new FormData();
upstream.append('name', name); upstream.append('name', name);