Now i decided to use leveled logger in my Go programm. At this moment it's logrus.
But after some investigation (through pain) found that there are much loggers: glog, log15, logrus and so on. So, now i want try to use logrus and have
possibility to change it on another without fixing all my sources where log is used.
I tried to create my own package logger which only imports logrus:
package logger
import "github.com/Sirupsen/logrus"
func init() {
logrus.SetFormater(new(logrus.TextFormater))
}
In all other my sources a want to use i in such way: // main.go
package main
import log "logger"
func main() {
log.Print(...)
log.Debug(...)
and so on
}
But compiler says me that there are no such methods in logger package. Is there a way just import some package A to my own package B and use in my code all methods of A through B?
The reason what i need this is to have a chance quickly change logrus to ahother logger in future which support same methods just replacing several lines of code in my own logger file without replacing import log "github.com/Sirupsen/logrus" on import log "github.com/some_bestlogger" over all sources