JuliaLang / StyledStrings.jl

Write with ✨ style ✨ and ease
https://julialang.github.io/StyledStrings.jl/
MIT License
26 stars 9 forks source link

Application of faces to logging macros doesn't seem to work #96

Open Amval opened 12 hours ago

Amval commented 12 hours ago

Hello, I am trying to use StyledStrings with the logging macros (@info, @debug in particular).

In the documentation there is this example:

julia> StyledStrings.withfaces(:log_info => [:magenta, :italic]) do
           @info "Hello there"
       end
[ Info: Hello there

which doesn't seem to apply. I am not able to make it work either. For reference, my local setup:

Julia Version 1.10.4
Commit 48d4fd48430 (2024-06-04 10:41 UTC)
Build Info:
  Official https://julialang.org/ release
Platform Info:
  OS: macOS (arm64-apple-darwin22.4.0)
  CPU: 8 × Apple M2
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-15.0.7 (ORCJIT, apple-m1)
Threads: 4 default, 0 interactive, 2 GC (on 4 virtual cores)
Environment:
  JULIA_EDITOR = code
  JULIA_NUM_THREADS = 4
  JULIA_DEBUG = nothing

Is this not supported yet or perhaps just not in Julia 1.10? Thanks in advance.

tecosaur commented 12 hours ago

This was a 1.11+ thing, but https://github.com/JuliaLang/julia/pull/51829 was reverted when ConsoleLogging was moved to Base since printing of Base.AnnotatedStrings isn't in Base, and so this example no longer works.