Skip to content
This repository has been archived by the owner on Apr 26, 2021. It is now read-only.

Debugging Program O

Dave Morton edited this page Oct 25, 2016 · 1 revision

Debugging Program O - the Anatomy of a Typical Debug File

Intro

One of the features that Program O has had since its very beginning has been it's ability to create debugging output, typically in the form of a text file. This can prove useful in aiding botmasters with troubleshooting blank or unexpected responses, but the structure of the debug file can be a bit daunting at first. In an effort to help botmasters understand what they're seeing when they look at a debug file, I've written this article to outline what's contained within a debug file, and how to read it. Let's start at the beginning, shall we? Here's what the beginning of a typical debug file looks like:

###Structure Program O's debug files are made up of small sections of text called sections. A section is at least four (4) lines long, and starts with the "current" date and time, the "called" debug level (more on this later) the "default" debug level and the time elapsed since the last section was created (or since the script was first initialized, as is the case with the very first section). the last line is just a series of hyphens to indicate the end of the current section. The second line in each section gives the filename, the name of the function that's calling the debug logger and its line number (again, more about this later). the remaining line(s) contain the actual message being logged. Let's take a look at what the first section of a debug file looks like:

24-10-2016 04:03:03.20897[0][4] - Elapsed time: 2.117 milliseconds
[conversation_start.php][Called outside of function][49]
Conversation starting. Current system specs:
  Program O version:            2.6.3
  Server Software:              Apache/2.4.17 (Win64) OpenSSL/1.0.2d PHP/5.6.18
  PHP Version:                  5.6.18
  OS:                           Windows NT
  OS Version:                   build 10586 (Windows 10)
  MySQL Version:                5.7.9-log
  Multi-byte functions enabled: true 
-----------------------

This first section of the debug file provides important information about the server environment that Program O is running in, as well as Program O's version. If you ever have an issue with Program O that you wish to post about here, this is probably the most important thing that you should add to your post, aside from the actual issue itself. Since Program O runs on a wide variety of operating systems and server software, our having this information allows us to run "apples to apples" tests to see what's happening, which makes the troubleshooting process go much faster for us. Ok, done preaching. Let's continue.

Let's break down the first line of that section, to see what information it contains, and what it means.

24-10-2016 04:03:03.20897[0][4] - Elapsed time: 2.117 milliseconds the entire line

24-10-2016 04:03:03.20897 This is the (then) current date and time, down to the millisecond [0] This is the debug level of the function call that created this section. The values are listed, below:

0: ALWAYS show this section [4]

  • Elapsed time: 2.117 milliseconds

###More to come...