                 printFreq(e.freq);
                 printRps(e.rps);
                 printOpmode(e.opmode);
-                printf(" irqLevel %u", hal_getIrqLevel());
 #if LMIC_ENABLE_event_logging
                 printAllRegisters();
 #endif

                    u1_t nwkKey[16];
                    u1_t artKey[16];
                    LMIC_getSessionKeys(&netid, &devaddr, nwkKey, artKey);
                    Serial.print("netid: ");
                    Serial.println(netid, DEC);
                    Serial.print("devaddr: ");
                    Serial.println(devaddr, HEX);
                    Serial.print("artKey: ");
                    for (int i=0; i<sizeof(artKey); ++i) {
                        if (i != 0)
                            Serial.print("-");
                        printHex2(artKey[i]);
                    }
                    Serial.println("");
                    Serial.print("nwkKey: ");
                    for (int i=0; i<sizeof(nwkKey); ++i) {
                            if (i != 0)
                                    Serial.print("-");
                            printHex2(nwkKey[i]);
                    }
                } while (0);

}

#if LMIC_ENABLE_event_logging
// dump all the registers.
void printAllRegisters(void) {
    uint8_t regbuf[0x80];
    regbuf[0] = 0;
