JyTee
JyTee

Reputation: 929

Firebase Crashlytics Custom Log Only Log Single Line

Recently my app has been crashing while trying to deserialize the JSON sent from the server and unfortunately the server doesn't record any log so I can't verify with them. So I decided to log the JSON response for this particular Api, I know that it's a bad practice to log server response but it's the only way I could try to identify the issue, the response for this api is not that long so I think it should be fine.

The issue comes in when I tried to reveal the log and found out it only shows one line in the firebase console as below:

raw response : {

The result I was expecting were something as below,vit shows up nicely in the debug console while developing using CLSNSLogv. I thought it will be the same in firebase console too but it was not the case.

raw response : {
        success ={
            Status = OK;
            Object1 = "test"
            Object2 = "test2"
        };
    }

Below is the code for logging, "value" is a dictionary as below:

value: [String : AnyObject]?
CLSLogv("raw response : %@", getVaList([value!]))

Appreciate your help

Upvotes: 2

Views: 1070

Answers (2)

XFawkes
XFawkes

Reputation: 383

This is a Crashlytics issue, my team has been experiencing this issue lately. We were printing dictionary using CLS_LOG in ObjC and we've noticed that it displays only first line of the dictionary.

I've contacted Crashlytics support team, and a guy from there confirmed a bug and told me that he contacted their engineering team for a fix.

You can change the way of logging for now to display everything in single line, or log by log, or you can wait for a fix.

Upvotes: 1

Alexizamerican
Alexizamerican

Reputation: 3354

You can convert the response to JSON using JSONSerialization and then remove all the carriage returns so that it's all one line. If you log that modified value it should appear correctly in the Crashlytics logs.

Upvotes: 0

Related Questions