Skip to content

Commit

Permalink
Use Fable compatible API for logging plugin load errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Maxime Mangel committed Aug 23, 2023
1 parent cfc9c9c commit 2e2fc98
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions src/Fable.Transforms/State.fs
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,14 @@ type Assemblies(getPlugin, fsharpAssemblies: FSharpAssembly list) =
let errorMessage =
$"Could not scan {path} for Fable plugins, skipping this assembly"

#if !FABLE_COMPILER
Console.ForegroundColor <- ConsoleColor.Gray
Console.Error.WriteLine(errorMessage)
#endif
Console.WriteLine(errorMessage)
#if !FABLE_COMPILER
Console.ResetColor()
#endif

hasSkippedAssembly <- true
false

Expand All @@ -65,13 +70,14 @@ type Assemblies(getPlugin, fsharpAssemblies: FSharpAssembly list) =
]
|> String.concat "\n"

#if FABLE_COMPILER
eprintfn "%s" errorMessage
#else
#if !FABLE_COMPILER
Console.ForegroundColor <- ConsoleColor.DarkRed
Console.Error.WriteLine(errorMessage)
#endif
Console.WriteLine(errorMessage)
#if !FABLE_COMPILER
Console.ResetColor()
#endif

raise ex

assemblies.Add(path, asm)
Expand Down

0 comments on commit 2e2fc98

Please sign in to comment.