func main() { SetLog() defer log.Close() var name = "skoo" log.Debug("log4go by %s", name) log.Info("log4go by %s", name) log.Warn("log4go by %s", name) log.Error("log4go by %s", name) log.Fatal("log4go by %s", name) }
func main() { SetLog() defer log.Close() var name = "skoo" for { log.Debug("log4go by %s", name) log.Info("log4go by %s", name) log.Warn("log4go by %s", name) log.Error("log4go by %s", name) log.Fatal("log4go by %s", name) time.Sleep(time.Second * 1) } }
func main() { defer log4go.Close() pixiv := pixivspy.NewPixivspy(config.Info.User, config.Info.Password) if !pixiv.Login() { return } downloadPath := util.FixPathName(config.Info.DownloadPath) log4go.Info("检查下载目录: %s", downloadPath) if !util.CheckFileIsExist(downloadPath) { log4go.Info("创建下载目录: %s", downloadPath) os.MkdirAll(downloadPath, 0777) } switch config.Info.Mode { case "id": for _, id := range config.Info.IDS { pixiv.DownloadMemberIllusts(id) } case "star": if len(config.Info.IDS) == 0 { pixiv.DownloadStar("") } else { for _, id := range config.Info.IDS { pixiv.DownloadStar(id) } } default: log4go.Error("Mode必须为[star | id]") } pixiv.WaitDownload() }