Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
Write a script to loop through your app folders, find .java files and replace the line with "Log.".
GG -
You don't have to remove logs if you don't have any *insert in that popular meme format*
-
DevVsCat957y+1 on what @mohammed suggested. Can be easily done with a bash script and sed, maybe?
But I cant believe Android Studio or any plugins cant do this already.... really? -
Axis8127yrpl is a gnu tool created for this! It supports globbing file patterns and replaces strings :)
-
@him- this.
There is a configuration for removing all log calls when building the app -
Try ctrl+shift+r for replacing across project?
Works in pycharm I'm guessing it may work in Android studio
No idea about android -
A text editor's find in files (and replace in files) feature can make quick work of that. Try Sublime or notepad++ or....
-
Make a custom logging function, call the custom function everywhere and Log only inside the custom function. Then you can just have a flag that makes it so Log doesn't get called if it's a production build.
(I don't develop for Android so idk if this is actually practical but this is what's been done on every decent project I've ever worked on. It's nice because it lets you easily customize the logging behavior in one place.)
Related Rants
Me: Yes! I'm finally ready to upload my first Android app to PlayStore, im so excited!!
Google: Make sure to remove all the Log calls from your code.
Me: *Finds out that there's no way Android studio can make it for you*
FUUUUUUUU**
undefined
android
logs
android studio