mirror of
https://github.com/rancher/os.git
synced 2025-09-01 14:48:55 +00:00
try to simplify logging
Signed-off-by: Sven Dowideit <SvenDowideit@home.org.au>
This commit is contained in:
33
log/log.go
33
log/log.go
@@ -109,29 +109,32 @@ func InitLogger() {
|
||||
}
|
||||
thisLog := logrus.New()
|
||||
|
||||
filename := "/dev/kmsg"
|
||||
f, err := os.OpenFile(filename, os.O_WRONLY, 0644)
|
||||
if err != nil {
|
||||
logrus.Debugf("error opening /dev/kmsg %s", err)
|
||||
}
|
||||
|
||||
// Filter what the user sees (info level, unless they set --debug)
|
||||
stdLogger := logrus.StandardLogger()
|
||||
showuserHook, err := NewShowuserlogHook(stdLogger.Level)
|
||||
if err != nil {
|
||||
f.Close()
|
||||
logrus.Errorf("hook failure %s", err)
|
||||
return
|
||||
}
|
||||
|
||||
// We're all set up, now we can make it global
|
||||
appLog = thisLog
|
||||
userHook = showuserHook
|
||||
// TODO: look into containerized syslog
|
||||
//filename := "/dev/kmsg"
|
||||
filename := "/var/log/log"
|
||||
f, err := os.OpenFile(filename, os.O_WRONLY, 0644)
|
||||
if err != nil {
|
||||
logrus.Debugf("error opening %s: %s", filename, err)
|
||||
} else {
|
||||
// We're all set up, now we can make it global
|
||||
appLog = thisLog
|
||||
userHook = showuserHook
|
||||
|
||||
thisLog.Hooks.Add(showuserHook)
|
||||
logrus.StandardLogger().Hooks.Add(showuserHook)
|
||||
thisLog.Out = f
|
||||
logrus.SetOutput(f)
|
||||
thisLog.Level = logrus.DebugLevel
|
||||
thisLog.Hooks.Add(showuserHook)
|
||||
logrus.StandardLogger().Hooks.Add(showuserHook)
|
||||
|
||||
thisLog.Out = f
|
||||
logrus.SetOutput(f)
|
||||
thisLog.Level = logrus.DebugLevel
|
||||
}
|
||||
|
||||
pwd, err := os.Getwd()
|
||||
if err != nil {
|
||||
|
@@ -35,7 +35,6 @@ cp /usr/lib/ISOLINUX/isolinux.bin ${CD}/boot/isolinux/
|
||||
cp /usr/lib/syslinux/modules/bios/ldlinux.c32 ${CD}/boot/isolinux/
|
||||
# add the installer image to the iso for non-network / dev/test
|
||||
cp ${ARTIFACTS}/installer.tar ${CD}/rancheros/
|
||||
cp assets/bootinfoscript ${CD}/rancheros/
|
||||
gzip ${CD}/rancheros/installer.tar
|
||||
cd ${CD} && xorriso \
|
||||
-as mkisofs \
|
||||
|
Reference in New Issue
Block a user