{
int port;
int iocp;
+ int verbose;
};
/* Try to guess a good content-type for 'path' */
memset(&o, 0, sizeof(o));
- while ((opt = getopt(argc, argv, "p:I")) != -1) {
+ while ((opt = getopt(argc, argv, "p:Iv")) != -1) {
switch (opt) {
case 'p': o.port = atoi(optarg); break;
case 'I': o.iocp = 1; break;
+ case 'v': ++o.verbose; break;
default : fprintf(stderr, "Unknown option %c\n", opt); break;
}
}
setbuf(stdout, NULL);
setbuf(stderr, NULL);
+ /** Read env like in regress" */
+ if (o.verbose || getenv("EVENT_DEBUG_LOGGING_ALL"))
+ event_enable_debug_logging(EVENT_DBG_ALL);
+
cfg = event_config_new();
#ifdef _WIN32
if (o.iocp) {
event_config_set_num_cpus_hint(cfg, 8);
}
#endif
+
base = event_base_new_with_config(cfg);
if (!base) {
fprintf(stderr, "Couldn't create an event_base: exiting\n");