flag.BoolVar(&LogConnectionState,"LogConnectionState",true,"Include connection state changes in log")
flag.StringVar(&PMResponse,"PMResponse","This is an automated service. For enquiries, please contact an administrator.","Message to respond with on PM")
flag.BoolVar(&DebugMode,"Debug",false,"Print additional information on stdout")
flag.Parse()
// Assert dir exists
dinfo,err:=os.Stat(BaseDir)
iferr!=nil{
fmt.Fprintf(os.Stderr,"FATAL: %s",err.Error())
os.Exit(1)
}
if!dinfo.IsDir(){
fmt.Fprintf(os.Stderr,"FATAL: Path '%s' is not a directory\n",BaseDir)
}
// Launch loggers
all_hubs:=strings.Split(*hubs,",")
launch_ct:=0
for_,hubaddr:=rangeall_hubs{
iflen(hubaddr)==0{
continue
}
// Assert target directory exists
os.MkdirAll(GetDirectoryNameForHub(hubaddr),0755)
// Launch logger
goHubWorker(hubaddr,*nick,*password)
launch_ct++
}
iflaunch_ct==0{
fmt.Fprintln(os.Stderr,"FATAL: No hubs specified")