-
Notifications
You must be signed in to change notification settings - Fork 80
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
soundmanger2.js console.log #13
Comments
Hi! I editted the index.js in the react-sound folder where i change Is it possible for you to update it to that? so that all the debug messages wont appear in the console as it causes the app to be very laggy. |
hey! I used alias to resolve it! |
You can also use this on your component with sound to disable the soundManager console messages. componentDidMount () {
soundManager.setup({debugMode: false});
} That way you don't have to mess with the Webpack config (good if you are using something like |
@patrickpoh where in the web pack config file do I add that code? |
@jasan-s check this link out --> https://github.com/andrewjmead/react-course-boilerplate-app/blob/master/webpack.config.js |
thanks @patrickpoh . that worked like a charm. Could changes in sound manager break my app because of this line of code in my webpack config? |
@jasan-s you're welcome. Nope it wouldn't. |
Yes, the approach that @patrickpoh is mentioning is the one I'm using, and that works perfectly without any issues. However, maybe it would be good to try to automatically do that based on the NODE_ENV variable? That way the debug info won't ship to the prod bundle, and also this pattern is widely used in different libraries that are used with a bundler, be it webpack or browserify or whatever. What do you people think? What should be the default behavior? Or just documenting this webpack config alias would be enough? |
+1 for automatic suppress of logs using env variable status in production.
…On Nov 29, 2016 12:30 PM, "Leonardo Garcia Crespo" ***@***.***> wrote:
Yes, the approach that @patrickpoh <https://github.com/patrickpoh> is
mentioning is the one I'm using, and that works perfectly without any
issues. However, maybe it would be good to try to automatically do that
based on the NODE_ENV variable? That way the debug info won't ship to the
prod bundle, and also this pattern is widely used in different libraries
that are used with a bundler, be it webpack or browserify or whatever.
What do you people think? What should be the default behavior? Or just
documenting this webpack config alias would be enough?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#13 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ANOMEVyPzlONhxx2FX302rcM5GjIRzRqks5rDIs5gaJpZM4JlUZs>
.
|
+1 for not logging as default |
@juandjara I am precisely in the situation you write: I am using How do you get hold of the I have tried:
but I get |
@baharev I write this code some time ago for my website http://freetunes.fuken.xyz so I do remember very well how I did it. But here is the code, https://github.com/juandjara/ftunes-client/blob/master/src/player/Player.js It seems that you don't have to import |
@juandjara Thanks for the quick response. In the
I inserted the following 3 lines after the imports but before anything else:
Seems to work OK. Apparently the And is the top level index.js of my app a safe place for these 3 lines? I appreciate your help. |
@baharev well you can do it this way but I suggest you put it in the file of the component where you are actually using the And the The thing that is happening here is this: When you import |
@juandjara Thanks for the explanation.
Okay, and why? Why is my workaround dangerous / suboptimal / wrong? When could it backfire? What if I have 16 different components in my application that use
code into all 16 components just in case that component is mounted first? And if 12 of them are pure functional components, do I have to turn all 12 of them into classes just to implement Sorry if this is a dumb question, but I am an absolute beginner, and I would like to understand why the way that you are suggesting is better / safer than my workaround. Thanks for your patience. |
@baharev if that it's the case your workaround is totally fine. I wrote it that way because I only use |
@juandjara That |
Fixed in v1.0.0 https://github.com/leoasis/react-sound/releases/tag/v1.0.0 |
I use |
This one worked for me like a charm :
Then, add this to your constructor :
Or simply use it this way
|
can we not rely on process.env.NODE_ENV but props instead? |
Hi! Excellent library that you have made! However, the amount of stuff getting console.log is humongous!
Is there anyway to remove it? It's coming from soundmanger2.js.
The text was updated successfully, but these errors were encountered: