Skip to content

Instantly share code, notes, and snippets.

View dbushong's full-sized avatar

David Bushong dbushong

View GitHub Profile
$ cat foo.js
'use strict';
const asyncHooks = require('async_hooks');
const { writeSync } = require('fs');
const Memcached = require('memcached');
function debugHooks(types) {
// will contain metadata for all tracked events
'use strict';
const fs = require('fs');
const AH = require('async_hooks');
const net = require('net');
const { inspect } = require('util');
function log(...args) {
fs.writeSync(process.stdout.fd, `${args.map(x => inspect(x, { depth: null, colors: true })).join(' ')}\n`);
}
require "option_parser"
require "http/params"
def_fields = "ip,ident,user,year,mon,day,hour,min,sec,method,path,query," +
"http,code,bytes,referrer,ua"
quiet = false
fields_str = def_fields
output = STDOUT
print_header = false
DASH_FIELDS = %w(ident user referrer ua bytes)