1- using  Flow . Launcher . Plugin . BrowserBookmark . Models ; 
2- using  System . Collections . Generic ; 
1+ using  System . Collections . Generic ; 
32using  System . IO ; 
43using  System . Text . Json ; 
5- using  Flow . Launcher . Infrastructure . Logger ; 
64using  System ; 
5+ using  Flow . Launcher . Infrastructure . Logger ; 
6+ using  Flow . Launcher . Plugin . BrowserBookmark . Models ; 
77using  Microsoft . Data . Sqlite ; 
88
99namespace  Flow . Launcher . Plugin . BrowserBookmark ; 
1010
1111public  abstract  class  ChromiumBookmarkLoader  :  IBookmarkLoader 
1212{ 
13+     private  readonly  static   string  ClassName  =  nameof ( ChromiumBookmarkLoader ) ; 
14+ 
1315    private  readonly  string  _faviconCacheDir ; 
1416
1517    protected  ChromiumBookmarkLoader ( ) 
@@ -44,7 +46,7 @@ protected List<Bookmark> LoadBookmarks(string browserDataPath, string name)
4446            } 
4547            catch  ( Exception  ex ) 
4648            { 
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 ) ; 
4850            } 
4951
5052            var  source  =  name  +  ( Path . GetFileName ( profile )  ==  "Default"  ?  ""  :  $ " ({ Path . GetFileName ( profile ) } )") ; 
@@ -136,7 +138,7 @@ private void LoadFaviconsFromDb(string dbPath, List<Bookmark> bookmarks)
136138            } 
137139            catch  ( Exception  ex ) 
138140            { 
139-                 Log . Exception ( $ "Failed to copy favicon DB: { dbPath } ",  ex ) ; 
141+                 Main . _context . API . LogException ( ClassName ,   $ "Failed to copy favicon DB: { dbPath } ",  ex ) ; 
140142                return ; 
141143            } 
142144
@@ -189,7 +191,7 @@ ORDER BY b.width DESC
189191                    } 
190192                    catch  ( Exception  ex ) 
191193                    { 
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 ) ; 
193195                    } 
194196                } 
195197
@@ -199,7 +201,7 @@ ORDER BY b.width DESC
199201            } 
200202            catch  ( Exception  ex ) 
201203            { 
202-                 Log . Exception ( $ "Failed to connect to SQLite: { tempDbPath } ",  ex ) ; 
204+                 Main . _context . API . LogException ( ClassName ,   $ "Failed to connect to SQLite: { tempDbPath } ",  ex ) ; 
203205            } 
204206
205207            // Delete temporary file 
@@ -209,12 +211,12 @@ ORDER BY b.width DESC
209211            } 
210212            catch  ( Exception  ex ) 
211213            { 
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 ) ; 
213215            } 
214216        } 
215217        catch  ( Exception  ex ) 
216218        { 
217-             Log . Exception ( $ "Failed to load favicon DB: { dbPath } ",  ex ) ; 
219+             Main . _context . API . LogException ( ClassName ,   $ "Failed to load favicon DB: { dbPath } ",  ex ) ; 
218220        } 
219221    } 
220222
@@ -226,7 +228,7 @@ private static void SaveBitmapData(byte[] imageData, string outputPath)
226228        } 
227229        catch  ( Exception  ex ) 
228230        { 
229-             Log . Exception ( $ "Failed to save image: { outputPath } ",  ex ) ; 
231+             Main . _context . API . LogException ( ClassName ,   $ "Failed to save image: { outputPath } ",  ex ) ; 
230232        } 
231233    } 
232234} 
0 commit comments