6a243df4da
The multiaddresses protocols for websockets and dns are only registered with init() function when loading the modules. ipfs-cluster-ctl uses just the api, which did not load these modules so converting from serialized types caused bad panics. We have also ignored errors in the api library under the thinking that it would only parse things serialized by us, but this has made parsing errors to go unnoticed. From now, all errors are logged and some precautions are taking to better handle the possibility of nil objects. License: MIT Signed-off-by: Hector Sanjuan <code@hector.link>
33 lines
478 B
Go
33 lines
478 B
Go
package ipfscluster
|
|
|
|
import logging "github.com/ipfs/go-log"
|
|
|
|
var logger = logging.Logger("cluster")
|
|
|
|
var facilities = []string{
|
|
"cluster",
|
|
"restapi",
|
|
"ipfshttp",
|
|
"monitor",
|
|
"mapstate",
|
|
"consensus",
|
|
"raft",
|
|
"pintracker",
|
|
"ascendalloc",
|
|
"diskinfo",
|
|
"apitypes",
|
|
}
|
|
|
|
// SetFacilityLogLevel sets the log level for a given module
|
|
func SetFacilityLogLevel(f, l string) {
|
|
/*
|
|
CRITICAL Level = iota
|
|
ERROR
|
|
WARNING
|
|
NOTICE
|
|
INFO
|
|
DEBUG
|
|
*/
|
|
logging.SetLogLevel(f, l)
|
|
}
|