Fiber는 다양한 로그 라이브러리를 적용할 수 있는 AllLogger 인터페이스를 제공합니다.
type CommonLogger interface {
Logger
FormatLogger
WithLogger
}
type AllLogger interface {
CommonLogger
ControlLogger
WithLogger
}
Print log
Fatal 레벨을 호출하는 방법은 로그를 출력한 후 프로그램 실행을 중단하므로 주의해서 사용하세요.
다양한 레벨의 로그를 직접 출력하면 messageKey에 입력되며, 기본값은 msg입니다.
log.Info("Hello, World!")
log.Debug("Are you OK?")
log.Info("42 is the answer to life, the universe, and everything")
log.Warn("We are under attack!")
log.Error("Houston, we have a problem.")
log.Fatal("So Long, and Thanks for All the Fislog.")
log.Panic("The system is down.")
다양한 레벨의 로그를 포맷팅하여 출력하며, 모든 메소드는 f로 끝납니다.
log.Debugf("Hello %s", "boy")
log.Infof("%d is the answer to life, the universe, and everything", 233)
log.Warnf("We are under attack %s!", "boss")
log.Errorf("%s, we have a problem.", "Master Shifu")
log.Fatalf("So Long, and Thanks for All the %s.", "banana")
키와 값을 가진 메시지를 출력하거나, 키와 값이 쌍을 이루지 않으면 KEYVALS UNPAIRED를 출력합니다.