2

We want to display object info (id,coordinates,tags) in the android logs. Is there there any generic way of displaying the required info in the logs ? Something like extending cclog or adding alternative classes.

New Guy
  • 66
  • 3

1 Answers1

0

You can use the JSON.stringify() function to output objects with cc.log. They are shown in the adb logcat output.

var obj = {
   id: "foo",
   coords: {
      long: 13.4434343,
      latt: 45.3235698
   }
};

cc.log(JSON.stringify(obj));
Michael
  • 6,823
  • 11
  • 54
  • 84