1. A downhole measurement-while-drilling (MWD) tool with diagnostic capability comprising: a. directional sensors; b. electronics processing capability; c. a mud pulse telemetry assembly; and d. a power source; wherein said downhole measurement-while-drilling tool records and transmits measured MWD recorded events to a surface recording and display system; and wherein said measurement-while-drilling tool comprises one or more printed circuit boards with firmware processors that internally record significant system diagnostic events that can be time correlated with known tool operational problems.