comparison pkg/geoserver/boot.go @ 3306:bf5ab7a069e2

More compact logging of GeoServer booting.
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Fri, 17 May 2019 11:24:06 +0200
parents fd14f149696c
children 36129677ff24
comparison
equal deleted inserted replaced
3305:5932f9574493 3306:bf5ab7a069e2
262 // instead of an empty array *palmface*. 262 // instead of an empty array *palmface*.
263 // So assume there no features. 263 // So assume there no features.
264 hasFeature = func(string) bool { return false } 264 hasFeature = func(string) bool { return false }
265 } 265 }
266 266
267 var already []string
268
269 defer func() {
270 if len(already) > 0 {
271 log.Printf("info: already having featuretypes: %s\n",
272 strings.Join(already, ", "))
273 }
274 }()
275
267 for i := range tables { 276 for i := range tables {
268 table := tables[i].Name 277 table := tables[i].Name
269 278
270 if hasFeature(table) { 279 if hasFeature(table) {
271 log.Printf("info: featuretype %s already exists.\n", table) 280 already = append(already, table)
272 continue 281 continue
273 } 282 }
274 283
275 // Create featuretype. 284 // Create featuretype.
276 log.Printf("info: creating featuretype %s.\n", table) 285 log.Printf("info: creating featuretype %s.\n", table)
527 entries := models.InternalServices.Filter( 536 entries := models.InternalServices.Filter(
528 models.IntAnd( 537 models.IntAnd(
529 models.IntWMS, 538 models.IntWMS,
530 models.IntWithStyle)) 539 models.IntWithStyle))
531 540
541 var already []string
542
543 defer func() {
544 if len(already) > 0 {
545 log.Printf("info: already having styles: %s\n",
546 strings.Join(already, ", "))
547 }
548 }()
549
532 for i := range entries { 550 for i := range entries {
533 entry := &entries[i] 551 entry := &entries[i]
534 if stls.hasStyle(entry.Name) { 552 if stls.hasStyle(entry.Name) {
535 log.Printf("warn: already has style for %s\n", entry.Name) 553 already = append(already, entry.Name)
536 continue 554 continue
537 } 555 }
538 if err := updateStyle(entry, true); err != nil { 556 if err := updateStyle(entry, true); err != nil {
539 return err 557 return err
540 } 558 }