1
- using Flow . Launcher . Plugin . BrowserBookmark . Models ;
2
- using System . Collections . Generic ;
1
+ using System . Collections . Generic ;
3
2
using System . IO ;
4
3
using System . Text . Json ;
5
- using Flow . Launcher . Infrastructure . Logger ;
6
4
using System ;
5
+ using Flow . Launcher . Infrastructure . Logger ;
6
+ using Flow . Launcher . Plugin . BrowserBookmark . Models ;
7
7
using Microsoft . Data . Sqlite ;
8
8
9
9
namespace Flow . Launcher . Plugin . BrowserBookmark ;
10
10
11
11
public abstract class ChromiumBookmarkLoader : IBookmarkLoader
12
12
{
13
+ private readonly static string ClassName = nameof ( ChromiumBookmarkLoader ) ;
14
+
13
15
private readonly string _faviconCacheDir ;
14
16
15
17
protected ChromiumBookmarkLoader ( )
@@ -44,7 +46,7 @@ protected List<Bookmark> LoadBookmarks(string browserDataPath, string name)
44
46
}
45
47
catch ( Exception ex )
46
48
{
47
- Log . Exception ( $ "Failed to register bookmark file monitoring: { bookmarkPath } ", ex ) ;
49
+ Main . _context . API . LogException ( ClassName , $ "Failed to register bookmark file monitoring: { bookmarkPath } ", ex ) ;
48
50
}
49
51
50
52
var source = name + ( Path . GetFileName ( profile ) == "Default" ? "" : $ " ({ Path . GetFileName ( profile ) } )") ;
@@ -136,7 +138,7 @@ private void LoadFaviconsFromDb(string dbPath, List<Bookmark> bookmarks)
136
138
}
137
139
catch ( Exception ex )
138
140
{
139
- Log . Exception ( $ "Failed to copy favicon DB: { dbPath } ", ex ) ;
141
+ Main . _context . API . LogException ( ClassName , $ "Failed to copy favicon DB: { dbPath } ", ex ) ;
140
142
return ;
141
143
}
142
144
@@ -189,7 +191,7 @@ ORDER BY b.width DESC
189
191
}
190
192
catch ( Exception ex )
191
193
{
192
- Log . Exception ( $ "Failed to extract bookmark favicon: { bookmark . Url } ", ex ) ;
194
+ Main . _context . API . LogException ( ClassName , $ "Failed to extract bookmark favicon: { bookmark . Url } ", ex ) ;
193
195
}
194
196
}
195
197
@@ -199,7 +201,7 @@ ORDER BY b.width DESC
199
201
}
200
202
catch ( Exception ex )
201
203
{
202
- Log . Exception ( $ "Failed to connect to SQLite: { tempDbPath } ", ex ) ;
204
+ Main . _context . API . LogException ( ClassName , $ "Failed to connect to SQLite: { tempDbPath } ", ex ) ;
203
205
}
204
206
205
207
// Delete temporary file
@@ -209,12 +211,12 @@ ORDER BY b.width DESC
209
211
}
210
212
catch ( Exception ex )
211
213
{
212
- Log . Exception ( $ "Failed to delete temporary favicon DB: { tempDbPath } ", ex ) ;
214
+ Main . _context . API . LogException ( ClassName , $ "Failed to delete temporary favicon DB: { tempDbPath } ", ex ) ;
213
215
}
214
216
}
215
217
catch ( Exception ex )
216
218
{
217
- Log . Exception ( $ "Failed to load favicon DB: { dbPath } ", ex ) ;
219
+ Main . _context . API . LogException ( ClassName , $ "Failed to load favicon DB: { dbPath } ", ex ) ;
218
220
}
219
221
}
220
222
@@ -226,7 +228,7 @@ private static void SaveBitmapData(byte[] imageData, string outputPath)
226
228
}
227
229
catch ( Exception ex )
228
230
{
229
- Log . Exception ( $ "Failed to save image: { outputPath } ", ex ) ;
231
+ Main . _context . API . LogException ( ClassName , $ "Failed to save image: { outputPath } ", ex ) ;
230
232
}
231
233
}
232
234
}
0 commit comments