Nmap Development mailing list archives

Re: [NSE] Reflection facilities for better verbose/debug output


From: Patrick Donnelly <batrick () batbytes com>
Date: Mon, 24 Sep 2012 01:48:08 -0400

On Mon, Sep 24, 2012 at 12:40 AM, David Fifield <david () bamsoftware com> wrote:
This is a good idea. Let us not simply alias print_debug and
print_verbose to the new functions, because of the double script id
problem you mentioned. Rather let's keep the behavior of those functions
the same and deprecate them, and then change scripts to use the new
names, pruning script ids when needed. This way we have an incentive to
migrate scripts so that they serve as examples of the new style.

That's better, yes.

NSE: ['http-default-accounts' (thread: 0x3231610)] HTTP: Host returns proper 404 result.

Could this be more concise? Like

NSE: [http-default-accounts 0x3231610] HTTP: Host returns proper 404 result.

One of the possible outputs is (not shown in my original example):

NSE: [http-default-accounts (worker thread: 0xdeadbeef)] ...

I felt knowing if output is coming from a worker might be useful
(although you don't know the parent of the worker just from the
message; however, there would be an earlier debug message from NSE
when the parent calls stdnse.new_thread). With your trimmed version,
that might look like:

NSE: [http-default-accounts worker 0xdeadbeef] ...

a shorter version might also be:

NSE: [http-default-accounts W:0xdeadbeef] ...

compared to

NSE: [http-default-accounts M:0xdeadbee] ...

where M and W are respectively Master and Worker, naturally.

A version that would include the parent might look like:

NSE: [http-default-accounts M:0xdeadbee:W:0xdeadbeef] ...

Thoughts?

Even that is quite long; maybe the thread id should only be there for
-d2 or higher.

That's one possibility.

-- 
- Patrick Donnelly
_______________________________________________
Sent through the nmap-dev mailing list
http://cgi.insecure.org/mailman/listinfo/nmap-dev
Archived at http://seclists.org/nmap-dev/


Current thread: