Skip to content

Commit

Permalink
Expose setLogLevel to debug
Browse files Browse the repository at this point in the history
  • Loading branch information
hackerwins committed Jul 8, 2024
1 parent a35e640 commit 69bc8c3
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
1 change: 1 addition & 0 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,7 @@ <h4 class="title">
const codemirror = CodeMirror.fromTextArea(textarea, {
lineNumbers: true,
});
yorkie.setLogLevel(yorkie.LogLevel.Debug);
devtool.setCodeMirror(codemirror);

// 02-1. create client with RPCAddr.
Expand Down
8 changes: 5 additions & 3 deletions src/client/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
8 changes: 6 additions & 2 deletions src/yorkie.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -143,6 +143,8 @@ export default {
Text,
Counter,
Tree,
LogLevel,
setLogLevel,
IntType: CounterType.IntegerCnt,
LongType: CounterType.LongCnt,
};
Expand All @@ -156,6 +158,8 @@ if (typeof globalThis !== 'undefined') {
Text,
Counter,
Tree,
LogLevel,
setLogLevel,
IntType: CounterType.IntegerCnt,
LongType: CounterType.LongCnt,
};
Expand Down

0 comments on commit 69bc8c3

Please sign in to comment.