本文整理匯總了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
}
}