Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

what does the TAG represent in Log code in android?

When do we use TAG in the log code and when do we use the string?

What does TAG represent in log codes?

For example, what are the differences between these two lines of code and How do I know when to choose which one?
Log.d(TAG, "onClick: ");
Log.d("string" , "onClick: ");

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

TAG is a best practice (good convention).

after defining a TAG constant, you could use it in the subsequent log calling.

‘string’ also works, but it’s Hard Coding.

See this wiki about Hard Coding

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading