Giter VIP home page Giter VIP logo

Comments (2)

ghjwp7 avatar ghjwp7 commented on August 18, 2024

Maybe this issue should be closed, as it isn't a Crayons issue. It probably is a Julia-print-system issue or a logging.jl issue that could be mentioned in Crayons docs.

To see it isn't a Crayons issue, note that while 'Hello' printed ok in gray foreground, the at the beginning of the second line switched to cyan color. That is, the print-system or logging applied a color change that ignored and overrode the previous setting. Instead of changing back to previous color after that, the print-system or logging apparently set a default color.

I don't see any color changes in logging.jl and don't know where the cyan or green colors were set. In 1.7.0-rc2 REPL on my Linux system, white is the default color instead of green. Running your test code in a program file has the same result as in REPL.

A workaround might be to store the desired Crayon setup in a variable or function C, and reapply it after a \n. Eg, @info C("Hello,\n"), C("Universe!") or @info "$(C)Hello,\n$(C)Universe!". I'm not sure if the latter is feasible and don't know whether Crayons stores the current state aside from user-initiated stacking. I think it isn't able to detect from scratch what the state is.

from crayons.jl.

czylabsonasa avatar czylabsonasa commented on August 18, 2024

as a quick & dirty workaround i would define a function that takes a Crayon c and a message String m and apply c for each of the "rows" of m:

image

(rdrw stands for redefine row wise :-) )

from crayons.jl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.