ReTeX / ReX

ReX - typesetting mathematics
121 stars 8 forks source link

logging… #18

Open ghost opened 7 years ago

ghost commented 7 years ago

I would like to see output on the JS side looking like:

layout …  Ok
    [I] preparing XYZ
    [W] problem ..
    [I] finishing XYZ

rendering … Error
    [I] allocating resources
    [I] collecting glyphs
    drawing formula … Ok
        [I] rasterizing glyphs
        [I] painting glyphs
    [E] cannot save image

this might be created by the following calls

let layout_log = log.create_context("layout");
layout_log.info("preparing {}", z.name);
layout_log.warn("problem {:d}", …);
layout_log.info("finishing {}", z.name);

let render_log = log.create_context("rendering");
render_log.info("allocating resouces");
let drawing_log = render_log.create_context("drawing formula");
drawing_log.info("rasterizing glyphs");
drawing_log.info("painting glyphs");

render_log.error("cannot save image");
ghost commented 7 years ago

blocks https://github.com/ReTeX/ReX/issues/25

cbreeden commented 7 years ago

I'd imagine that using the log crate here would be fine? We might just need to create a new frontend.