beagle icon indicating copy to clipboard operation
beagle copied to clipboard

All logs

Open Alival-IT opened this issue 4 years ago • 4 comments

Hello, is it possible to share all the logs from device? not just the logged one throught timber but from logcat

Alival-IT avatar Jul 02 '21 14:07 Alival-IT

Sounds useful, thanks for the idea! Note to self

Let me think about how to best expose this functionality using the library, I'll definitely look into it and keep you updated.

In the mean time you might be able to hack some extra, custom data into the "build information" section of the bug reporting screen, but I'd be careful with Strings that are too long.

Beagle.initialize(
    application = application,
    behavior = Behavior(
        ...
        bugReportingBehavior = Behavior.BugReportingBehavior(
            ...
            buildInformation = {
                listOf(
                    "Version name".toText() to versionName,
                    "Custom information" to "Anything"
                )
            }
        )
    )
)

Edit: on second thought, yeah, a simple file in the bugreport for the logcat going back N minutes would be great, I'll see what I can do

pandulapeter avatar Jul 02 '21 15:07 pandulapeter

@pandulapeter Hello there, any updates on this topic?

Also I see that every log I select to share, is in a separate txt file, result in a huge list of txt files sometimes with 1 line

this is my logger enabler

    enum class LogLabels(val label: String) {
        a("a"),
        b("b"),
        c("c")
    }
....



            behavior = Behavior(
                logBehavior = Behavior.LogBehavior(
                    loggers = listOf(BeagleLogger),
                ),
                bugReportingBehavior = Behavior.BugReportingBehavior(
                    logLabelSectionsToShow = listOf(null, *LogLabels.values().map { it.label }.toTypedArray()),
                    lifecycleSectionEventTypes = emptyList(),
                    buildInformation = {
                        listOf(
                            "Version name".toText() to context.getCurrentVersionName(),
                            "Version code".toText() to context.getCurrentVersionCode().toString(),
                            "Application ID".toText() to context.applicationContext.packageName
                        )
                    }
                ),
                networkLogBehavior = Behavior.NetworkLogBehavior(
                    networkLoggers = listOf(BeagleOkHttpLogger)
                )
            )

Screenshot 2022-04-28 at 09 23 23

Alival-IT avatar Apr 28 '22 06:04 Alival-IT

@alivDev1 Sorry for kindof forgetting about this issue.

Revisiting the topic: exporting all logcat messages into a file is not something the library should provide in my opinion. If anybody needs that functionality, they should implement it on their own and simply add a TextModule to Beagle to execute that piece of logic.

On the other hand Beagle's Bug Report screen creating those many files is admittedly not ideal. That definitely is something I should improve, so let me keep this issue open. Sorry that I can't give you an estimate, it's a bigger undertaking.

pandulapeter avatar Apr 28 '22 09:04 pandulapeter

No problem at all, thanks for response 👍

Alival-IT avatar Apr 28 '22 09:04 Alival-IT