本文整理汇总了Golang中github.com/BestianRU/SABModules/SBMSystem.LogFile.ON方法的典型用法代码示例。如果您正苦于以下问题:Golang LogFile.ON方法的具体用法?Golang LogFile.ON怎么用?Golang LogFile.ON使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类github.com/BestianRU/SABModules/SBMSystem.LogFile
的用法示例。
在下文中一共展示了LogFile.ON方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: main
func main() {
var (
jsonConfig SBMSystem.ReadJSONConfig
rLog SBMSystem.LogFile
pg SBMConnect.PgSQL
)
const (
pName = string("SABook CardDAVMaker Poller")
pVer = string("5 2015.11.25.21.00")
)
jsonConfig.Init("./CardDAVMaker.log", "./CardDAVMaker.json")
rLog.ON(jsonConfig)
if pg.Init(jsonConfig, "insert into aaa_dav_ntu values (0,123);") != 0 {
rLog.Log("POLLER: Poll insert error!")
}
defer pg.Close()
rLog.OFF()
}
示例2: main
func main() {
var (
jsonConfig SBMSystem.ReadJSONConfig
rLog SBMSystem.LogFile
pid SBMSystem.PidFile
sleepWatch = int(0)
)
const (
pName = string("SABook CardDAVMaker")
pVer = string("5 2015.11.25.21.00")
)
fmt.Printf("\n\t%s V%s\n\n", pName, pVer)
jsonConfig.Init("./CardDAVMaker.log", "./CardDAVMaker.json")
rLog.ON(jsonConfig)
pid.ON(jsonConfig)
pid.OFF(jsonConfig)
rLog.OFF()
SBMSystem.Fork(jsonConfig)
SBMSystem.Signal(jsonConfig, pid)
rLog.ON(jsonConfig)
pid.ON(jsonConfig)
defer pid.OFF(jsonConfig)
rLog.Hello(pName, pVer)
rLog.OFF()
for {
rLog.ON(jsonConfig)
jsonConfig.Update()
if checkNTUWishes(jsonConfig, rLog) > 0 {
rLog.Hello(pName, pVer)
goNTUWork(jsonConfig, rLog)
sleepWatch = 0
}
if sleepWatch > 3600 {
rLog.Log("<-- I'm alive ... :)")
sleepWatch = 0
}
rLog.OFF()
time.Sleep(time.Duration(jsonConfig.Conf.Sleep_Time) * time.Second)
sleepWatch += jsonConfig.Conf.Sleep_Time
}
}