Update the Logger component.
[master-thesis.git] / Parasitemia / ParasitemiaUI / GUI.fs
index 0a93d90..35bc2ad 100644 (file)
@@ -266,7 +266,7 @@ let run (defaultConfig : Config) (fileToOpen : string option) =
             displayStatusMessage "Document saved"
         with
         | :? IOException as ex ->
-            Log.Error(ex.ToString())
+            Log.Error "%O" ex
             MessageBox.Show(sprintf "The document cannot be save in \"%s\"" state.FilePath, "Error saving the document", MessageBoxButton.OK, MessageBoxImage.Error) |> ignore
 
     let saveCurrentDocumentAsNewFile () =
@@ -384,7 +384,7 @@ let run (defaultConfig : Config) (fileToOpen : string option) =
             updateGUI ()
         with
         | :? IOException as ex ->
-            Log.Error(ex.ToString())
+            Log.Error "%O" ex
             state.FilePath <- previousFilePath
             MessageBox.Show(sprintf "The document cannot be loaded from \"%s\"" filepath, "Error loading the document", MessageBoxButton.OK, MessageBoxImage.Error) |> ignore
 
@@ -414,7 +414,7 @@ let run (defaultConfig : Config) (fileToOpen : string option) =
                 Export.exportResults state dialog.FileName
             with
             | :? IOException as ex ->
-                Log.Error(ex.ToString())
+                Log.Error "%O" ex
                 MessageBox.Show(sprintf "The results cannot be exported in \"%s\"" state.FilePath, "Error exporting the files", MessageBoxButton.OK, MessageBoxImage.Error) |> ignore
 
     let importImage () =
@@ -429,7 +429,7 @@ let run (defaultConfig : Config) (fileToOpen : string option) =
                     addPreview srcImg
                 with
                 | _ as ex ->
-                    Log.Error(ex.ToString())
+                    Log.Error "%O" ex
                     MessageBox.Show(sprintf "Unable to read the image from \"%s\"" filename, "Error adding an image", MessageBoxButton.OK, MessageBoxImage.Error) |> ignore
 
             updateGlobalParasitemia ()