Giter VIP home page Giter VIP logo

steamclog-android's People

Contributors

jacobminer avatar ssawchenko avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

steamclog-android's Issues

Remove Firebase Crashyltics completely

Since we no longer want to use Firebase Crashlytics as our crash reporting system AND because issues were found while attempting to use only Sentry on a client project, we should just remove the previous Crashlytics support and force the few existing apps we have using steamclog to move to Sentry.

Create signing keystore

Before we make public we should look at creating a signing key for the library (do not store in repo) and sign our AARs with it. How does this work with hosting via Jitpack? Maybe we don't even need a signing key if hosted on jitpack?

Extra data being added to Sentry title is cluttering up logs

Currently if we have extra data, there is a chance it may be appended to the title of the Sentry ticket.
image.png

This is cluttering up the page and makes tickets harder to read.
We should look into ways to make it so the extra data is always added to the logs as breadcrumbs.

Create a new log endpoint for user reports that accepts dynamic strings

Automatically generated from steamclock/steamclog-swift#71

From a discussion in Slack:

User reports build up the report based on the text the user enters, but switching them to use the static string doesn’t work great, because it means all user reports will fold into the same error, which is not ideal for noticing or quick filing bugs.
Question is: do we just switch them to use static string anyway for now, and live with it being a bit more complicated to work with them. Or do we add some dynamic endpoint back into SteamcLog just for that (but that slightly defeats the purpose of trying to force people to use static strings and do it right, if there’s just an alternate endpoint that lets them do it wrong)?
The solution might be to have a dynamic non-fatal endpoint, but specifically name it “userReport” or something. That feels better then just going back to having some more generic “dynamicError” call, might be a little less likely to be accidentally misused. That function can eventually do a little bit of extra work. For example take a user info dictionary (with things like their device id for Spies), that it turns into tags on the sentry report, automatically collect a little more device info, attach the full text logs like we get with email reports, etc.

Add ability to rotate log files

Automatically generated from steamclock/steamclog-swift#34

Currently SteamcLog doesn't have the ability to rotate out log files, which is causing issues like https://github.com/steamclock/spies/issues/3959.

On iOS, we can use some of the built-in XCGLogger functionality, but Android may require more work.
XCGLogger provides AutoRotatingFileDestination with the following options:

targetMaxFileSize: Auto rotate once the file is larger than this (Default is 1_048_576)
targetMaxTimeInterval: Auto rotate after this many seconds (Default is 600)
targetMaxLogFiles: Number of archived log files to keep, older ones are automatically deleted (Default is 10)

At the very least, it seems like targetMaxTimeInterval would be useful for a first implementation.

@ssawchenko Do you know if Timber has similar functionality?

Implementation proposal:
Add an optional struct to the Config struct called FileAutoRotateParams (or something similar/better). Inside of that we can define rotateAfterSeconds and use that for creating the AutoRotatingFileDestination.

Check if we can redact optional properties

Found an issue in another project where we could not redact an optional property as the redacted list was expecting non optionals.

This may just have to be a limitation of using redaction in projects (ie. cannot be optional values)

Change LogLevelPresets to give more info on release builds

Right now the default release and releaseAdvanced presets are not including enough data to be useful when debugging common crash reports.

We have discussed making the following changes:

  • Change Release to log at info
  • Change ReleaseAdvanced to log at verbose

Apps with Proguard enabled crash when logging

Last version added a check on Debug Builds that did a run time check to ensure that the StackTrace we are creating for console logs was logging at the correct stack index. I was not applying the proper proguard rules for this though, and any Debug apps running would crash because the method name being used to apply the check was being munged.

Change package name

Not sure when it happened, but the library package name reads com.example.lib, which is not desired. Change library package name to com.steamclock.steamclog

Finalize VersionCode and VersionName formatting

We haven't really discussed version codes (usually handled by Bitrise) or names (v1.2 vs 2021.1).
Let's talk with the team and finalize these! Then make sure that they will match what we are tagging in our release steps in the Readme (I think I actually missed doing this)

Rework preset log levels

Automatically generated from steamclock/steamclog-swift#77

We've run into problems on multiple projects now where the release default not logging anything to disk has made issues harder to diagnose and fix. It may be a good idea to reconsider this and at least log warn and above to disk, although I think an argument could be made to include info as well.

Set debug level to Firehose by default

iOS set to Firehose, Android currently set to Develop

From iOS readme

// defined globally
#if DEBUG
private let config = Config(logLevel: .firehose) // this will be used in debug builds.
#else
private let config = Config(logLevel: .release) // this will be used for release builds
#endif

Add unit tests

Specifically, make sure to test that when we are using NonFatalException, the offset used for numToRemove puts us in an expected location.

Note, since NonFatalException existed only to support Crashlytics, once we remove support for it fully we will not need to test it.

Use Steamclog in Client Project

  1. Import library in the gradle file.
  2. Replace all Timber.X calls with related SCLog calls
  3. Non-fatals are currently logged by the CrashlyticsReporter.captureNonFatal method. May be worth having a sit down/pair program to figure out the best way to replace the existing Reporter interface with SCLog.
  4. Analytics currently logged by the AmplitudeAnalytics.log method; again, it may be worth a having a pair progam sit down to discuss how to replace this properly.

Update readme

Changes made to LogLevelPresets, update Readme to match

Add entry points that take an "Error"

Automatically generated from steamclock/steamclog-swift#50

In cases where we have an underlying error available,we should be able to pass it straight through rather than needing to generate a string ourselves from it (which has issues with localization, and is just more work).

We should definitely add this for the error level, and maybe consider it for the warn and fatal levels as well. Those wouldn't be as useful under Crashlytics, because we wouldn't want to report Crashlytics non-fatals for warnings or fatals, but assuming we do eventually move to Sentry, it has enough better categorization that it might be useful to send errors with a different tag on other levels for those that can be organized separately (for example, network errors could be sent at the warn level, giving the ability to track the frequency, how we do sometimes now by making network errors an analytic event, of those while still not having them generate issues automatically like errors do.

One design element that needs to be resolved before doing this: do we want to accept ALL errors, or do we want to force errors to opt in in some way, so that we can try and enforce the same redaction rules as we do for passing in objects.

On android the class involved isn't Error (java.lang.Throwable maybe?), but we shoudl do the same thing.

Sentry is submitting issues on debug builds

Using the following config, it seems like Sentry is still sending bug reports:

clog.initWith(isDebug = BuildConfig.DEBUG, fileWritePath = externalCacheDir)
if (!BuildConfig.DEBUG) {
    clog.config.logLevel = LogLevelPreset.Release
}

Add mechanism to allow a "User report" error to be created

From #53

There's a quirk with how Sentry groups reports that contain Throwables:

Grouping by Stack Trace
When Sentry detects a stack trace in the event data (either directly or as part of an exception), the grouping is effectively based entirely on the stack trace.

This "grouping" seems to assume that the message names for the grouped Throwable is the same - this led to a case in my sample project where I was using a generic Throwable with multiple messages in the same function that were becoming grouped on the Sentry dashboard, with state of the message seeming to change based on the last report made.

iOS Parity
Check and see if these "User reports" on iOS also contain stack trace info.

  • If yes, then we may need to look at adding stack trace data IN THE LOGS only
  • If no, then I believe the Android library already supports this by allowing an error to be created using just a message string

Give feedback if attempting to attach a non-Redactable object

While integrating with a client project I forgot to extend my data classes with Redactable, this resulted in the Sentry report simply not being set. As it took me awhile to figure out this was the issue, we should look into (1) allowing non-Redactable objects to be attached (not sure if iOS allows this) or (2) log a separate error (console, maybe even non-fatal) to track that this case has occurred.

Make sure LogLevelPresets are being adhered to

LogLevelPreset Disk Level System Level Remote Level
firehose verbose verbose none
develop none debug none
release none none warn
releaseAdvanced verbose none warn

Go over each Destination and make sure that log levels are being adhered to.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.