diff options
Diffstat (limited to 'cmd/monfront/create.go')
-rw-r--r-- | cmd/monfront/create.go | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/cmd/monfront/create.go b/cmd/monfront/create.go index 43805a1..e11679f 100644 --- a/cmd/monfront/create.go +++ b/cmd/monfront/create.go @@ -3,7 +3,6 @@ package main import ( "database/sql" "fmt" - "log" "net/http" "strings" ) @@ -38,14 +37,14 @@ func showCreate(con *Context) { rows, err := DB.Query(prim.query) defer rows.Close() if err != nil { - log.Printf("could not get commands: %s", err) + con.log.Info("could not get commands", "error", err) con.Error = "could not get commands" returnError(http.StatusInternalServerError, con, con.w) return } result, err := rowsToResult(rows) if err != nil { - log.Printf("could not get %s: %s", prim.name, err) + con.log.Info("could not get", "primitive", prim.name, "error", err) con.Error = "could not get " + prim.name returnError(http.StatusInternalServerError, con, con.w) return @@ -137,7 +136,7 @@ func addCreate(con *Context) { stmt := `insert into ` + t.Table + `(` + strings.Join(t.Fields, ",") + `) values (` + strings.Join(vals, ",") + `)` _, err := DB.Exec(stmt, fields...) if err != nil { - log.Printf("could not insert new %s: %s", addType, err) + con.log.Info("could not insert new type", "type", addType, "error", err) con.Error = "could not insert new " + addType returnError(http.StatusInternalServerError, con, con.w) return |