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

Add an option to use compact tag format to DebugAntilog #93

Open
Vlad-M-1 opened this issue Jan 12, 2022 · 3 comments
Open

Add an option to use compact tag format to DebugAntilog #93

Vlad-M-1 opened this issue Jan 12, 2022 · 3 comments

Comments

@Vlad-M-1
Copy link

Vlad-M-1 commented Jan 12, 2022

Method name etc in the tag can be verbose in some cases.

For example, error messages in the projects I'm working on are more or less unique. And there's no need for the detailed tags.

It takes more time and cognitive efforts to read log lines with long tags. And in this case it doesn't seem to provide enough value to justify it.

An option to use short tags seems like a reasonable addition. Class name as a tag would make logs look like default Android logs. Which is what lots of developers are used to.
And those who prefer long tags would still be able to use them.

Of course, there is an option to implement custom Antilog in a project. But it seems to be an extra effort multiplied by a number of platforms multiplied by a number of devs who prefer short tags :)

Another option with writing short tags for each Napier call manually would also be not the most pleasant thing.

What do you think?

@AAkira
Copy link
Owner

AAkira commented Jan 26, 2022

When I first created this library, I was dissatisfied with MPP modules that could only use print, because I could not recognize which file was outputting the log with just print.

So I added a default tag to display the file path and name in the Napier.
If you want to set a shorter tag, I have designed it so that you can make a custom Antilog as you say.

I could provide an option to set the tags at once, but I'm not thinking about it right now.
Do you have a better solution?

@Vlad-M-1
Copy link
Author

Vlad-M-1 commented Jan 26, 2022

Oh, I see. I think it's ok. It was more of a suggestion. Writing a custom Antilog appeared to be fine.

Thank you for the reply.

@frontiertsymbal
Copy link

frontiertsymbal commented Sep 6, 2022

Hello @AAkira. I have a slightly different question, but also related to the tag. Previously, I used Timber and I had the opportunity to make a clickable tag for the logcat. Now I'm using your library - how can I implement the same functional for this library? Thank you!

class HyperlinkedDebugTree : Timber.DebugTree() { override fun createStackElementTag(element: StackTraceElement) = element.run { "($fileName:$lineNumber)$methodName()" } }

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

3 participants