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

FirebaseCrashlytics log() method takes only a message without priority and tag #1202

Closed
ghost opened this issue Feb 5, 2020 · 12 comments
Closed
Labels

Comments

@ghost
Copy link

ghost commented Feb 5, 2020

Why the only way to log something is FirebaseCrashlytics.getInstance().log(message) without tag and priority ? If we look the implementation, we see that this method calls the CrashlyticsCore method
public void log(String msg) { this.doLog(3, "FirebaseCrashlytics", msg); }

and this method sets always a the Debug priority (3) and the tag "FirebaseCrashlytics" which is not really readable in the firebase crash console.
Is this a bug ?

Thank you

@google-oss-bot
Copy link
Contributor

I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.

@aguatno aguatno added api: crashlytics type: question Further information is requested and removed needs-triage labels Feb 5, 2020
@aguatno
Copy link

aguatno commented Feb 5, 2020

Hi @lionel-dangelo thanks for filling this issue. Crashlytic.log() has a similar method with same name, but different argument wherein you can set the tag and priority, see image below for reference.

Screenshot from 2020-02-05 23-46-34

@ghost
Copy link
Author

ghost commented Feb 5, 2020

Thank you for your answer, but I try to use the new implementation of FirebaseCrashlytics (without Fabric)
https://firebase.google.com/docs/crashlytics/get-started-new-sdk?platform=android
So I don't have the "Crashlytics" class anymore and the new class "FirebaseCrashlytics" exposes only log(String msg)
Maybe is there an other way with the new implementation ?

@aguatno
Copy link

aguatno commented Feb 5, 2020

Thanks for the clarification. It seems there should be another log() method with priority and tag as parameter, see here.

The Firebase Crashlytics SDK for Android is still a beta release so there are still a few issues that need to be addressed. I'll be tagging this issue as bug for now.

@aguatno aguatno added type: bug Something isn't working and removed type: question Further information is requested labels Feb 5, 2020
@ghost
Copy link
Author

ghost commented Feb 5, 2020

Thank you :)

@aguatno
Copy link

aguatno commented Feb 5, 2020

For now, you may try to log a message with tag using this syntax:

FirebaseCrashlytics.getInstance().log("E/TAG: my message");

You can read more here.

@ghost
Copy link
Author

ghost commented Feb 5, 2020

Yes it works, but like I said in my first message it's just not ideal because FirebaseCrashlytics.getInstance().log() calls the method log(msg) of CrashlyticsCore
public void log(String msg) { this.doLog(3, "FirebaseCrashlytics", msg); }
so alls my messages are prefixed by D/FirebaseCrashlytics
Example :
D/FirebaseCrashlytics I/SharedPrefsServiceImpl.kt:4)#<init>: SharedPrefsService initialization
D/FirebaseCrashlytics I/StorageServiceImpl.kt:2)#<init>: StorageService initialization
D/FirebaseCrashlytics I/ApiContextServiceImpl.kt:1)#l: Init authentication from prefs

I'm going to use the library like that and I'll wait for an improvement.
Thank you

@aguatno
Copy link

aguatno commented Feb 5, 2020

Issue is being tracked internally using bug#148943501. I'll keep you posted.

@aguatno
Copy link

aguatno commented Feb 10, 2020

Hi @lionel-dangelo I got feedback from our engineering team. It is intended behavior that priority and tag has been taken out in the Firebase Crashlytics SDK. We do log a priority and tag internally, but it's always "D/FirebaseCrashlytics,".

We would like to ask your feedback on what you think of either of these changes to the log method:

  1. Stop logging the superfluous "D/FirebaseCrashlytics"
  2. Allow users to configure that for display in their dashboard, without actually passing it through to logcat.

Thanks.

@aguatno aguatno added needs-info and removed type: bug Something isn't working labels Feb 10, 2020
@ghost
Copy link
Author

ghost commented Feb 13, 2020

Thank you for your answer.
Actually, not be able to pass a parameter for the priority is not a problem, because I can customize the message with my own prefix (E/ , W/ , I/).

So yes, I just think a good behavior could be stopping to log the superfluous "D/FirebaseCrashlytics"

For the moment, I have this on the firebase console (with the last implementation)

Capture d’écran 2020-02-13 à 19 58 52

And if I download the .log file from firebase :

Capture d’écran 2020-02-13 à 20 06 05

@aguatno
Copy link

aguatno commented Feb 19, 2020

Hi @lionel-dangelo We have implemented removing the uperfluous log and it will be released in beta02. Here's the pull request #1247.

Thanks so much for the feedback.

@aguatno
Copy link

aguatno commented Feb 19, 2020

I am closing this issue for now. I'd recommend checking out our releae notes to see when a PR makes it into an official release. Any new features/breaking changes/bug fixes should be detailed there :)

@aguatno aguatno closed this as completed Feb 19, 2020
@firebase firebase locked and limited conversation to collaborators Mar 21, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants