Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[webgl] Debug option for console.log in defShader? #217

Closed
stwind opened this issue Apr 7, 2020 · 5 comments
Closed

[webgl] Debug option for console.log in defShader? #217

stwind opened this issue Apr 7, 2020 · 5 comments

Comments

@stwind
Copy link
Contributor

stwind commented Apr 7, 2020

defShader prints the compiled programs in console. When working with multiple shaders I found the console logs a bit consufing. Would it be a good idea to add an option toggling this feature? something like:

defShader(gl, spec, { debug: true })
@postspectacular
Copy link
Member

Hey @stwind - thank you, this was an oversight/leftover effect from older times. I'd already switched the package to using a configurable logger rather than plain console.log, but forgot to update this call site...

For future reference (should create a wiki page for this) to enable/configure logging for this and other packages, do:

import { ConsoleLogger, LogLevel } from "@thi.ng/api";
import { setLogger } from "@thi.ng/webgl";

setLogger(new ConsoleLogger("webgl", LogLevel.DEBUG));

By default only a NullLogger is used, so you'll not see any output now, regardless of severity. There're other uses in the webgl pkg where also warnings are logged (e.g. invalid uniforms etc.), so if you just want to see those, use the above snippet w/ LogLevel.WARN...

@postspectacular
Copy link
Member

Added wiki page with further details: Package specific logger configuration

Hth!

@postspectacular
Copy link
Member

@stwind Btw. Will do another release tonight...

@stwind
Copy link
Contributor Author

stwind commented Apr 7, 2020

@postspectacular Awesome! Thanks!

@postspectacular
Copy link
Member

@stwind v1.0.4 now available :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants