Permalink
Browse files

make ros log to dmesg

Signed-off-by: Sven Dowideit <SvenDowideit@home.org.au>
  • Loading branch information...
1 parent 2e03f1b commit 4df962d4b66a2d11a7dabad7cd1b6667d02b644a @SvenDowideit SvenDowideit committed Nov 23, 2016
Showing with 691 additions and 169 deletions.
  1. +1 −1 cmd/cloudinitexecute/authorize_ssh_keys.go
  2. +2 −1 cmd/cloudinitexecute/cloudinitexecute.go
  3. +2 −1 cmd/cloudinitsave/cloudinitsave.go
  4. +8 −7 cmd/cloudinitsave/packet.go
  5. +1 −1 cmd/control/bootstrap.go
  6. +2 −1 cmd/control/cli.go
  7. +1 −1 cmd/control/config.go
  8. +1 −1 cmd/control/console.go
  9. +1 −1 cmd/control/console_init.go
  10. +1 −1 cmd/control/docker_init.go
  11. +1 −1 cmd/control/engine.go
  12. +1 −1 cmd/control/entrypoint.go
  13. +1 −1 cmd/control/install.go
  14. +1 −1 cmd/control/os.go
  15. +1 −1 cmd/control/preload.go
  16. +3 −3 cmd/control/service/app/app.go
  17. +8 −8 cmd/control/service/service.go
  18. +1 −1 cmd/control/switch_console.go
  19. +1 −1 cmd/control/tlsconf.go
  20. +1 −1 cmd/control/udevsettle.go
  21. +1 −1 cmd/control/user_docker.go
  22. +1 −1 cmd/control/util.go
  23. +2 −1 cmd/network/network.go
  24. +1 −1 cmd/power/power.go
  25. +2 −0 cmd/power/shutdown.go
  26. +2 −1 cmd/respawn/respawn.go
  27. +2 −1 cmd/sysinit/sysinit.go
  28. +2 −1 cmd/systemdocker/system-docker.go
  29. +4 −3 cmd/wait/wait.go
  30. +1 −1 compose/project.go
  31. +1 −1 compose/reload.go
  32. +1 −1 config/data_funcs.go
  33. +1 −1 config/disk.go
  34. +2 −1 dfs/scratch.go
  35. +1 −1 docker/auth.go
  36. +1 −1 docker/client_factory.go
  37. +5 −5 docker/service.go
  38. +3 −1 docs/os/contributing/index.md
  39. +4 −1 images/01-base/Dockerfile
  40. +1 −1 init/bootstrap.go
  41. +2 −1 init/init.go
  42. +1 −1 init/root.go
  43. +1 −1 init/selinux.go
  44. +1 −1 init/sysinit.go
  45. +143 −0 log/log.go
  46. +40 −0 log/showuserlog.go
  47. +7 −7 netconf/bonding.go
  48. +1 −1 netconf/ipv4ll_linux.go
  49. +1 −1 netconf/netconf_linux.go
  50. +1 −1 trash.conf
  51. +1 −1 util/network/cache.go
  52. +1 −1 util/network/network.go
  53. +2 −2 util/util.go
  54. +1 −0 vendor/github.com/Sirupsen/logrus/.travis.yml
  55. +7 −0 vendor/github.com/Sirupsen/logrus/CHANGELOG.md
  56. +68 −9 vendor/github.com/Sirupsen/logrus/README.md
  57. +64 −0 vendor/github.com/Sirupsen/logrus/alt_exit.go
  58. +35 −24 vendor/github.com/Sirupsen/logrus/entry.go
  59. +6 −9 vendor/github.com/Sirupsen/logrus/formatter.go
  60. +129 −33 vendor/github.com/Sirupsen/logrus/logger.go
  61. +46 −1 vendor/github.com/Sirupsen/logrus/logrus.go
  62. +8 −0 vendor/github.com/Sirupsen/logrus/terminal_appengine.go
  63. +1 −0 vendor/github.com/Sirupsen/logrus/terminal_bsd.go
  64. +2 −0 vendor/github.com/Sirupsen/logrus/terminal_linux.go
  65. +1 −0 vendor/github.com/Sirupsen/logrus/terminal_notwindows.go
  66. +1 −1 vendor/github.com/Sirupsen/logrus/terminal_solaris.go
  67. +1 −1 vendor/github.com/Sirupsen/logrus/terminal_windows.go
  68. +17 −10 vendor/github.com/Sirupsen/logrus/text_formatter.go
  69. +25 −3 vendor/github.com/Sirupsen/logrus/writer.go
@@ -7,7 +7,7 @@ import (
"strconv"
"strings"
- log "github.com/Sirupsen/logrus"
+ "github.com/rancher/os/log"
"github.com/rancher/os/util"
)
@@ -9,10 +9,10 @@ import (
"path"
"strings"
- log "github.com/Sirupsen/logrus"
"github.com/coreos/coreos-cloudinit/system"
rancherConfig "github.com/rancher/os/config"
"github.com/rancher/os/docker"
+ "github.com/rancher/os/log"
"github.com/rancher/os/util"
"golang.org/x/net/context"
)
@@ -37,6 +37,7 @@ func init() {
func Main() {
flags.Parse(os.Args[1:])
+ log.InitLogger()
log.Infof("Running cloud-init-execute: pre-console=%v, console=%v", preConsole, console)
cfg := rancherConfig.LoadConfig()
@@ -25,7 +25,6 @@ import (
yaml "github.com/cloudfoundry-incubator/candiedyaml"
- log "github.com/Sirupsen/logrus"
"github.com/coreos/coreos-cloudinit/config"
"github.com/coreos/coreos-cloudinit/datasource"
"github.com/coreos/coreos-cloudinit/datasource/configdrive"
@@ -40,6 +39,7 @@ import (
"github.com/rancher/os/cmd/cloudinitsave/gce"
"github.com/rancher/os/cmd/network"
rancherConfig "github.com/rancher/os/config"
+ "github.com/rancher/os/log"
"github.com/rancher/os/netconf"
"github.com/rancher/os/util"
)
@@ -54,6 +54,7 @@ const (
)
func Main() {
+ log.InitLogger()
log.Info("Running cloud-init-save")
cfg := rancherConfig.LoadConfig()
@@ -8,9 +8,10 @@ import (
"path"
"strings"
+ "github.com/rancher/os/log"
+
yaml "github.com/cloudfoundry-incubator/candiedyaml"
- "github.com/Sirupsen/logrus"
"github.com/packethost/packngo/metadata"
"github.com/rancher/os/config"
"github.com/rancher/os/netconf"
@@ -21,7 +22,7 @@ func enablePacketNetwork(cfg *config.RancherConfig) {
for _, v := range cfg.Network.Interfaces {
if v.Address != "" {
if err := netconf.ApplyNetworkConfigs(&cfg.Network); err != nil {
- logrus.Errorf("Failed to bootstrap network: %v", err)
+ log.Errorf("Failed to bootstrap network: %v", err)
return
}
bootStrapped = true
@@ -36,7 +37,7 @@ func enablePacketNetwork(cfg *config.RancherConfig) {
c := metadata.NewClient(http.DefaultClient)
m, err := c.Metadata.Get()
if err != nil {
- logrus.Errorf("Failed to get Packet metadata: %v", err)
+ log.Errorf("Failed to get Packet metadata: %v", err)
return
}
@@ -78,7 +79,7 @@ func enablePacketNetwork(cfg *config.RancherConfig) {
netCfg.Interfaces["bond0"] = bondCfg
b, _ := yaml.Marshal(netCfg)
- logrus.Debugf("Generated network config: %s", string(b))
+ log.Debugf("Generated network config: %s", string(b))
cc := config.CloudConfig{
Rancher: config.RancherConfig{
@@ -89,15 +90,15 @@ func enablePacketNetwork(cfg *config.RancherConfig) {
// Post to phone home URL on first boot
if _, err = os.Stat(config.CloudConfigNetworkFile); err != nil {
if _, err = http.Post(m.PhoneHomeURL, "application/json", bytes.NewReader([]byte{})); err != nil {
- logrus.Errorf("Failed to post to Packet phone home URL: %v", err)
+ log.Errorf("Failed to post to Packet phone home URL: %v", err)
}
}
if err := os.MkdirAll(path.Dir(config.CloudConfigNetworkFile), 0700); err != nil {
- logrus.Errorf("Failed to create directory for file %s: %v", config.CloudConfigNetworkFile, err)
+ log.Errorf("Failed to create directory for file %s: %v", config.CloudConfigNetworkFile, err)
}
if err := config.WriteToFile(cc, config.CloudConfigNetworkFile); err != nil {
- logrus.Errorf("Failed to save config file %s: %v", config.CloudConfigNetworkFile, err)
+ log.Errorf("Failed to save config file %s: %v", config.CloudConfigNetworkFile, err)
}
}
@@ -9,8 +9,8 @@ import (
"github.com/codegangsta/cli"
- log "github.com/Sirupsen/logrus"
"github.com/rancher/os/config"
+ "github.com/rancher/os/log"
"github.com/rancher/os/util"
)
View
@@ -3,13 +3,14 @@ package control
import (
"os"
- log "github.com/Sirupsen/logrus"
"github.com/codegangsta/cli"
"github.com/rancher/os/cmd/control/service"
"github.com/rancher/os/config"
+ "github.com/rancher/os/log"
)
func Main() {
+ log.InitLogger()
app := cli.NewApp()
app.Name = os.Args[0]
@@ -9,8 +9,8 @@ import (
"strings"
"text/template"
- log "github.com/Sirupsen/logrus"
yaml "github.com/cloudfoundry-incubator/candiedyaml"
+ "github.com/rancher/os/log"
"github.com/codegangsta/cli"
"github.com/rancher/os/config"
@@ -8,12 +8,12 @@ import (
"golang.org/x/net/context"
- log "github.com/Sirupsen/logrus"
"github.com/codegangsta/cli"
composeConfig "github.com/docker/libcompose/config"
"github.com/docker/libcompose/project/options"
"github.com/rancher/os/compose"
"github.com/rancher/os/config"
+ "github.com/rancher/os/log"
"github.com/rancher/os/util/network"
)
@@ -11,10 +11,10 @@ import (
"strings"
"syscall"
- log "github.com/Sirupsen/logrus"
"github.com/codegangsta/cli"
"github.com/rancher/os/cmd/cloudinitexecute"
"github.com/rancher/os/config"
+ "github.com/rancher/os/log"
"github.com/rancher/os/util"
)
@@ -9,9 +9,9 @@ import (
"syscall"
"time"
- log "github.com/Sirupsen/logrus"
"github.com/codegangsta/cli"
"github.com/rancher/os/config"
+ "github.com/rancher/os/log"
"github.com/rancher/os/util"
)
@@ -8,11 +8,11 @@ import (
"golang.org/x/net/context"
- log "github.com/Sirupsen/logrus"
"github.com/codegangsta/cli"
"github.com/docker/libcompose/project/options"
"github.com/rancher/os/compose"
"github.com/rancher/os/config"
+ "github.com/rancher/os/log"
"github.com/rancher/os/util/network"
)
@@ -5,8 +5,8 @@ import (
"os/exec"
"syscall"
- log "github.com/Sirupsen/logrus"
"github.com/codegangsta/cli"
+ "github.com/rancher/os/log"
"golang.org/x/net/context"
"github.com/rancher/os/cmd/cloudinitexecute"
@@ -6,7 +6,7 @@ import (
"os/exec"
"strings"
- log "github.com/Sirupsen/logrus"
+ "github.com/rancher/os/log"
"github.com/codegangsta/cli"
"github.com/rancher/os/cmd/power"
View
@@ -10,8 +10,8 @@ import (
"golang.org/x/net/context"
- log "github.com/Sirupsen/logrus"
yaml "github.com/cloudfoundry-incubator/candiedyaml"
+ "github.com/rancher/os/log"
"github.com/codegangsta/cli"
dockerClient "github.com/docker/engine-api/client"
@@ -13,9 +13,9 @@ import (
"github.com/codegangsta/cli"
- log "github.com/Sirupsen/logrus"
dockerClient "github.com/docker/engine-api/client"
"github.com/rancher/os/docker"
+ "github.com/rancher/os/log"
)
const (
@@ -7,9 +7,9 @@ import (
"strings"
"syscall"
+ "github.com/rancher/os/log"
"golang.org/x/net/context"
- "github.com/Sirupsen/logrus"
"github.com/codegangsta/cli"
"github.com/docker/libcompose/project"
"github.com/docker/libcompose/project/options"
@@ -102,7 +102,7 @@ func ProjectUp(p project.APIProject, c *cli.Context) error {
cleanupDone <- true
case err := <-errChan:
if err != nil {
- logrus.Fatal(err)
+ log.Fatal(err)
}
cleanupDone <- true
}
@@ -155,7 +155,7 @@ func ProjectDelete(p project.APIProject, c *cli.Context) error {
var answer string
_, err := fmt.Scanln(&answer)
if err != nil {
- logrus.Error(err)
+ log.Error(err)
return false
}
if answer != "y" && answer != "Y" {
@@ -4,13 +4,13 @@ import (
"fmt"
"strings"
- "github.com/Sirupsen/logrus"
"github.com/codegangsta/cli"
dockerApp "github.com/docker/libcompose/cli/docker/app"
"github.com/docker/libcompose/project"
"github.com/rancher/os/cmd/control/service/command"
"github.com/rancher/os/compose"
"github.com/rancher/os/config"
+ "github.com/rancher/os/log"
"github.com/rancher/os/util/network"
)
@@ -24,7 +24,7 @@ func (p *projectFactory) Create(c *cli.Context) (project.APIProject, error) {
func beforeApp(c *cli.Context) error {
if c.GlobalBool("verbose") {
- logrus.SetLevel(logrus.DebugLevel)
+ log.SetLevel(log.DebugLevel)
}
return nil
}
@@ -101,7 +101,7 @@ func disable(c *cli.Context) error {
if changed {
if err := updateIncludedServices(cfg); err != nil {
- logrus.Fatal(err)
+ log.Fatal(err)
}
}
@@ -122,7 +122,7 @@ func del(c *cli.Context) error {
if changed {
if err := updateIncludedServices(cfg); err != nil {
- logrus.Fatal(err)
+ log.Fatal(err)
}
}
@@ -137,7 +137,7 @@ func enable(c *cli.Context) error {
for _, service := range c.Args() {
if val, ok := cfg.Rancher.ServicesInclude[service]; !ok || !val {
if strings.HasPrefix(service, "/") && !strings.HasPrefix(service, "/var/lib/rancher/conf") {
- logrus.Fatalf("ERROR: Service should be in path /var/lib/rancher/conf")
+ log.Fatalf("ERROR: Service should be in path /var/lib/rancher/conf")
}
cfg.Rancher.ServicesInclude[service] = true
@@ -147,11 +147,11 @@ func enable(c *cli.Context) error {
if len(enabledServices) > 0 {
if err := compose.StageServices(cfg, enabledServices...); err != nil {
- logrus.Fatal(err)
+ log.Fatal(err)
}
if err := updateIncludedServices(cfg); err != nil {
- logrus.Fatal(err)
+ log.Fatal(err)
}
}
@@ -168,7 +168,7 @@ func list(c *cli.Context) error {
services, err := network.GetServices(cfg.Rancher.Repositories.ToArray())
if err != nil {
- logrus.Fatalf("Failed to get services: %v", err)
+ log.Fatalf("Failed to get services: %v", err)
}
for _, service := range services {
@@ -3,11 +3,11 @@ package control
import (
"errors"
- log "github.com/Sirupsen/logrus"
"github.com/codegangsta/cli"
"github.com/docker/libcompose/project/options"
"github.com/rancher/os/compose"
"github.com/rancher/os/config"
+ "github.com/rancher/os/log"
"golang.org/x/net/context"
)
@@ -5,7 +5,7 @@ import (
"os"
"path/filepath"
- log "github.com/Sirupsen/logrus"
+ "github.com/rancher/os/log"
"github.com/codegangsta/cli"
machineUtil "github.com/docker/machine/utils"
@@ -4,8 +4,8 @@ import (
"os"
"os/exec"
- log "github.com/Sirupsen/logrus"
"github.com/codegangsta/cli"
+ "github.com/rancher/os/log"
)
func udevSettleAction(c *cli.Context) {
@@ -12,13 +12,13 @@ import (
"path/filepath"
- log "github.com/Sirupsen/logrus"
"github.com/codegangsta/cli"
composeClient "github.com/docker/libcompose/docker/client"
"github.com/docker/libcompose/project"
"github.com/rancher/os/compose"
"github.com/rancher/os/config"
rosDocker "github.com/rancher/os/docker"
+ "github.com/rancher/os/log"
"github.com/rancher/os/util"
)
View
@@ -4,7 +4,7 @@ import (
"fmt"
"strings"
- log "github.com/Sirupsen/logrus"
+ "github.com/rancher/os/log"
)
func yes(question string) bool {
Oops, something went wrong.

0 comments on commit 4df962d

Please sign in to comment.