runtime: Fix global logger configuration.
We used to configure the global logger inside rt.Init(), but that is too
late, since the runtime factories can call the global logger before
rt.Init() is called.
In particular, the internal.HasPublicIP function runs before rt.Init(),
and calls the global logger.
The safest thing seems to be to configure the global logger immediately
after parsing flags, as implemented in this CL.
Change-Id: I8a316fb4c642f81a1e1ee2c3d5b9af1e3ee90923
diff --git a/runtime/factories/roaming/roaming.go b/runtime/factories/roaming/roaming.go
index aca495d..b5f17c6 100644
--- a/runtime/factories/roaming/roaming.go
+++ b/runtime/factories/roaming/roaming.go
@@ -58,7 +58,7 @@
}
func Init(ctx *context.T) (v23.Runtime, *context.T, v23.Shutdown, error) {
- if err := internal.ParseFlags(commonFlags); err != nil {
+ if err := internal.ParseFlagsAndConfigureGlobalLogger(commonFlags); err != nil {
return nil, nil, nil, err
}