Skip to content

Commit 4abd5b1

Browse files
committed
feat: log update
1 parent c0bed75 commit 4abd5b1

File tree

4 files changed

+9
-11
lines changed

4 files changed

+9
-11
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ node_modules
33
dist
44
dist-ssr
55
*.local
6+
memos-sync-test-graph/

readme.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,8 @@
2020

2121
## Limit
2222

23-
- Only sync last 1000 memos.
2423
- if memo exist, cannot update the content. We don't want to break your content.
25-
- Cannot sync content from logseq to memos.
26-
- Cannot send image and files to Memos.
24+
- Cannot send image and files between Memos and logseq. (If you want this feature, welcome PR)
2725

2826
## ScreenShot
2927

src/main.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import settingSchema, { Visibility } from "./settings";
55
import MemosSync from "./memos";
66

77
function main() {
8-
console.log("Logseq Memos Plugin Loading!");
8+
console.info("memos-sync: Logseq Memos Plugin Loading!");
99

1010
settingSchema();
1111

@@ -25,7 +25,6 @@ function main() {
2525

2626
const { sendVisibility }: any = logseq.settings;
2727
sendVisibility.forEach((visibility: Visibility) => {
28-
console.log(visibility);
2928
logseq.Editor.registerSlashCommand(
3029
`memos: Send in ${visibility}`,
3130
async () => {

src/memos.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ class MemosSync {
4747
logseq.UI.showMsg("Memos Sync Success", "success");
4848
}
4949
} catch (e) {
50-
console.error(e);
50+
console.error("memos-sync: ",e);
5151
if (mode !== "Background") {
5252
logseq.UI.showMsg(String(e), "error");
5353
}
@@ -71,7 +71,7 @@ class MemosSync {
7171

7272
private async sync() {
7373
await this.beforeSync();
74-
74+
7575
let maxMemoId = await this.lastSyncId();
7676
let newMaxMemoId = maxMemoId;
7777
let end = false;
@@ -155,15 +155,15 @@ class MemosSync {
155155

156156
this.backgroundConfigChange();
157157
} catch (e) {
158-
console.error(e);
158+
console.error("memos-sync: ",e);
159159
logseq.UI.showMsg("Memos OpenAPI is not a URL", "error");
160160
}
161161
}
162162

163163
public async post(block: BlockEntity | null, visibility: Visibility) {
164164
try {
165165
if (block === null) {
166-
console.error("block is not exits");
166+
console.error("memos-sync: block is not exits");
167167
await logseq.UI.showMsg("block is not exits", "error");
168168
return;
169169
}
@@ -188,7 +188,7 @@ class MemosSync {
188188
await logseq.UI.showMsg("Post memo success");
189189
}
190190
} catch (error) {
191-
console.error(error);
191+
console.error("memos-sync: ",error);
192192
await logseq.UI.showMsg(String(error), "error");
193193
}
194194
}
@@ -270,7 +270,6 @@ class MemosSync {
270270
const blocks = await logseq.Editor.getPageBlocksTree(page);
271271

272272
const inboxBlock = blocks.find((block: { content: string }) => {
273-
console.log(block);
274273
return block.content === inboxName;
275274
});
276275

@@ -298,6 +297,7 @@ class MemosSync {
298297
if (!parentBlock) {
299298
throw "Not able to create parent Block";
300299
}
300+
console.debug('memos-sync: parentBlock', parentBlock)
301301
await logseq.Editor.insertBatchBlock(
302302
parentBlock.uuid,
303303
memoContentGenerate(

0 commit comments

Comments
 (0)