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 ref = p.ref ?? '';
console.log('[Sheet] Notify content received:', {
logger.debug('[Sheet] Notify content received:', {
msg,
target,
currentUid,
@ -597,7 +597,7 @@ export async function handleIncomingMessages(raw: string, clientPrivateKey?: Cry
);
let actual_message: WSMessage = JSON.parse(decrypted_string);
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);
@ -605,7 +605,7 @@ export async function handleIncomingMessages(raw: string, clientPrivateKey?: Cry
} else {
const msg: WSMessage = parsedMessage;
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) {
// error response

View file

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

View file

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

View file

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

View file

@ -29,7 +29,7 @@ export const POST: RequestHandler = async ({ request }) => {
`${API_BASE}/catalog/create/${encodeURIComponent(country)}/${encodeURIComponent(uid)}` +
`/${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();
upstream.append('slug', slug);

View file

@ -43,7 +43,7 @@ export const POST: RequestHandler = async ({ request }) => {
`${API_BASE}/video/mainpage/${encodeURIComponent(uid)}` +
`/${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();
upstream.append('name', name);