Gaia/Email/SecretDebugMode: Difference between revisions

Jump to navigation Jump to search
no edit summary
(Created page with "It's a secret to everybody... who has not read this wiki page. == What's so cool about the secret debug menu? == The secret debug menu exposes logging functionality for debuggi...")
 
No edit summary
Line 9: Line 9:
For example, the log definition for the IMAP protocol connection, eliding other entry definitions etc, looks like:
For example, the log definition for the IMAP protocol connection, eliding other entry definitions etc, looks like:


'''
  var LOGFAB = exports.LOGFAB = $log.register(module, {
var LOGFAB = exports.LOGFAB = $log.register(module, {
    ImapProtoConn: {
  ImapProtoConn: {
      events: {
    events: {
        data: { length: false },
      data: { length: false },
      },
    },
      TEST_ONLY_events: {
    TEST_ONLY_events: {
        // This may be a Buffer and therefore need to be coerced
      // This may be a Buffer and therefore need to be coerced
        data: { data: $log.TOSTRING },
      data: { data: $log.TOSTRING },
      },
    },
  }); // end LOGFAB
}); // end LOGFAB
'''


The logging code then looks like:
The logging code then looks like:
Line 65: Line 63:
Here is a script that works for me on a computer with a device attached to grab the file to /tmp/gem-log.json:
Here is a script that works for me on a computer with a device attached to grab the file to /tmp/gem-log.json:


'''
  #!/bin/bash
#!/bin/bash
  set -o errexit
set -o errexit
  set -o pipefail
set -o pipefail


# maybe grep instead of
  # maybe grep instead of
logpath=`adb shell ls /mnt/sdcard/DCIM/gem-log-*.rm | head -1 | tr -d '\n\r'`
  logpath=`adb shell ls /mnt/sdcard/DCIM/gem-log-*.rm | head -1 | tr -d '\n\r'`
echo I am grabbing: $logpath
  echo I am grabbing: $logpath
adb pull ${logpath} /tmp/gem-log.json
  adb pull ${logpath} /tmp/gem-log.json
adb shell rm $logpath
  adb shell rm $logpath
'''


Here is a script that works for me when using b2g-desktop on linux:
Here is a script that works for me when using b2g-desktop on linux:
'''
#!/bin/bash
set -o errexit
set -o pipefail


# maybe grep instead of
  #!/bin/bash
logpath=`ls ~/Videos/gem-log-*.rm | head -1 | tr -d '\n\r'`
  set -o errexit
echo I am grabbing: $logpath
  set -o pipefail
mv ${logpath} /tmp/gem-log.json
 
chmod a+r /tmp/gem-log.json
  # maybe grep instead of
'''
  logpath=`ls ~/Videos/gem-log-*.rm | head -1 | tr -d '\n\r'`
  echo I am grabbing: $logpath
  mv ${logpath} /tmp/gem-log.json
  chmod a+r /tmp/gem-log.json
 
== Interpreting the log files ==
 
Check out a copy of arbitrarypushlog and build the standalone mode with a "?log=PATHTOLOG" argument, keeping in mind that you may need to host both the source and the log file at the same origin in order for things to work if the log file is not served with blanket CORS permissions.
 
Alternatively, you can either use the index.html referenced above with "?log=LOGURL" appended or copy the files that make it up to wherever you want and CORS is not a problem.
Confirmed users
360

edits

Navigation menu