mirror of https://github.com/perkeep/perkeep.git
Debug environment variable to CAMLI_DEBUG_CONFIG dump low-level config.
Change-Id: I7e7830112b8f10c5695ad53fd867fb5736925cef
This commit is contained in:
parent
029d66fa9e
commit
b07f2f9973
|
@ -17,11 +17,13 @@ limitations under the License.
|
|||
package serverconfig
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"log"
|
||||
"net/http"
|
||||
"os"
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
"camlistore.org/pkg/auth"
|
||||
|
@ -301,6 +303,10 @@ func Load(filename string) (*Config, error) {
|
|||
"Failed to transform user config file %q into internal handler configuration: %v",
|
||||
filename, err)
|
||||
}
|
||||
if v, _ := strconv.ParseBool(os.Getenv("CAMLI_DEBUG_CONFIG")); v {
|
||||
jsconf, _ := json.MarshalIndent(conf.Obj, "", " ")
|
||||
log.Printf("From high-level config, generated low-level config: %s", jsconf)
|
||||
}
|
||||
}
|
||||
|
||||
return conf, nil
|
||||
|
|
Loading…
Reference in New Issue