mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-01-06 04:09:40 -06:00
revert storage, remove tracing.service and bring back common
This commit is contained in:
@@ -61,16 +61,16 @@ func ParseConfig(c *cli.Context, cfg *config.Config) error {
|
||||
}
|
||||
|
||||
// provide with defaults for shared logging, since we need a valid destination address for BindEnv.
|
||||
//if cfg.Log == nil && cfg.Commons != nil && cfg.Commons.Log != nil {
|
||||
// cfg.Log = &shared.Log{
|
||||
// Level: cfg.Commons.Log.Level,
|
||||
// Pretty: cfg.Commons.Log.Pretty,
|
||||
// Color: cfg.Commons.Log.Color,
|
||||
// File: cfg.Commons.Log.File,
|
||||
// }
|
||||
//} else if cfg.Log == nil && cfg.Commons == nil {
|
||||
// cfg.Log = &shared.Log{}
|
||||
//}
|
||||
if cfg.Log == nil && cfg.Commons != nil && cfg.Commons.Log != nil {
|
||||
cfg.Log = &config.Log{
|
||||
Level: cfg.Commons.Log.Level,
|
||||
Pretty: cfg.Commons.Log.Pretty,
|
||||
Color: cfg.Commons.Log.Color,
|
||||
File: cfg.Commons.Log.File,
|
||||
}
|
||||
} else if cfg.Log == nil && cfg.Commons == nil {
|
||||
cfg.Log = &config.Log{}
|
||||
}
|
||||
|
||||
// load all env variables relevant to the config in the current context.
|
||||
envCfg := config.Config{}
|
||||
@@ -93,7 +93,7 @@ type SutureService struct {
|
||||
|
||||
// NewSutureService creates a new ocs.SutureService
|
||||
func NewSutureService(cfg *ociscfg.Config) suture.Service {
|
||||
//cfg.OCS.Commons = cfg.Commons
|
||||
cfg.OCS.Commons = cfg.Commons
|
||||
return SutureService{
|
||||
cfg: cfg.OCS,
|
||||
}
|
||||
|
||||
@@ -2,14 +2,18 @@ package config
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/owncloud/ocis/ocis-pkg/shared"
|
||||
)
|
||||
|
||||
// Config combines all available configuration parts.
|
||||
type Config struct {
|
||||
*shared.Commons
|
||||
|
||||
Service Service
|
||||
|
||||
Tracing Tracing `ocisConfig:"tracing"`
|
||||
Log Log `ocisConfig:"log"`
|
||||
Log *Log `ocisConfig:"log"`
|
||||
Debug Debug `ocisConfig:"debug"`
|
||||
|
||||
HTTP HTTP `ocisConfig:"http"`
|
||||
|
||||
@@ -27,7 +27,6 @@ func DefaultConfig() *Config {
|
||||
Type: "jaeger",
|
||||
Endpoint: "",
|
||||
Collector: "",
|
||||
Service: "ocs",
|
||||
},
|
||||
TokenManager: TokenManager{
|
||||
JWTSecret: "Pive-Fumkiu4",
|
||||
|
||||
@@ -6,5 +6,4 @@ type Tracing struct {
|
||||
Type string `ocisConfig:"type" env:"OCIS_TRACING_TYPE;OCS_TRACING_TYPE"`
|
||||
Endpoint string `ocisConfig:"endpoint" env:"OCIS_TRACING_ENDPOINT;OCS_TRACING_ENDPOINT"`
|
||||
Collector string `ocisConfig:"collector" env:"OCIS_TRACING_COLLECTOR;OCS_TRACING_COLLECTOR"`
|
||||
Service string `ocisConfig:"service" env:"OCS_TRACING_SERVICE"`
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ import (
|
||||
)
|
||||
|
||||
// LoggerFromConfig initializes a service-specific logger instance.
|
||||
func Configure(name string, cfg config.Log) log.Logger {
|
||||
func Configure(name string, cfg *config.Log) log.Logger {
|
||||
return log.NewLogger(
|
||||
log.Name(name),
|
||||
log.Level(cfg.Level),
|
||||
|
||||
@@ -14,7 +14,7 @@ var (
|
||||
func Configure(cfg *config.Config) error {
|
||||
var err error
|
||||
if cfg.Tracing.Enabled {
|
||||
if TraceProvider, err = pkgtrace.GetTraceProvider(cfg.Tracing.Endpoint, cfg.Tracing.Collector, "ocs", cfg.Tracing.Type); err != nil {
|
||||
if TraceProvider, err = pkgtrace.GetTraceProvider(cfg.Tracing.Endpoint, cfg.Tracing.Collector, cfg.Service.Name, cfg.Tracing.Type); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user