From 69bc8c3d4503e5c6ba24076aeb7c98aa3a51f356 Mon Sep 17 00:00:00 2001 From: Youngteac Hong Date: Mon, 8 Jul 2024 15:55:36 +0900 Subject: [PATCH] Expose setLogLevel to debug --- public/index.html | 1 + src/client/client.ts | 8 +++++--- src/yorkie.ts | 8 ++++++-- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/public/index.html b/public/index.html index 92a56179c..55cbcf815 100644 --- a/public/index.html +++ b/public/index.html @@ -316,6 +316,7 @@

const codemirror = CodeMirror.fromTextArea(textarea, { lineNumbers: true, }); + yorkie.setLogLevel(yorkie.LogLevel.Debug); devtool.setCodeMirror(codemirror); // 02-1. create client with RPCAddr. diff --git a/src/client/client.ts b/src/client/client.ts index b0591f959..347eae23a 100644 --- a/src/client/client.ts +++ b/src/client/client.ts @@ -792,10 +792,12 @@ export class Client { } // NOTE(hackerwins): These errors are retryable. - // - Unknown: The error is unknown. It is retryable because it is unknown. - // - ResourceExhausted: The resource is exhausted. It is retryable because the resource may be available. - // - Unavailable: The server is unavailable. It is retryable because the server may be down. + // Connect guide indicates that for error codes like `ResourceExhausted` and + // `Unavailable`, retries should be attempted following their guidelines. + // Additionally, `Unknown` and `Canceled` are added separately as it + // typically occurs when the server is stopped. const retryables = [ + ConnectErrorCode.Canceled, ConnectErrorCode.Unknown, ConnectErrorCode.ResourceExhausted, ConnectErrorCode.Unavailable, diff --git a/src/yorkie.ts b/src/yorkie.ts index 5fdc5a284..8c9fda87f 100644 --- a/src/yorkie.ts +++ b/src/yorkie.ts @@ -113,8 +113,8 @@ export { export { Change } from '@yorkie-js-sdk/src/document/change/change'; export { converter } from '@yorkie-js-sdk/src/api/converter'; -export { LogLevel } from '@yorkie-js-sdk/src/util/logger'; -export { setLogLevel } from '@yorkie-js-sdk/src/util/logger'; +import { LogLevel, setLogLevel } from '@yorkie-js-sdk/src/util/logger'; +export { LogLevel, setLogLevel } from '@yorkie-js-sdk/src/util/logger'; export { EventSourceDevPanel, @@ -143,6 +143,8 @@ export default { Text, Counter, Tree, + LogLevel, + setLogLevel, IntType: CounterType.IntegerCnt, LongType: CounterType.LongCnt, }; @@ -156,6 +158,8 @@ if (typeof globalThis !== 'undefined') { Text, Counter, Tree, + LogLevel, + setLogLevel, IntType: CounterType.IntegerCnt, LongType: CounterType.LongCnt, };