本文整理匯總了Golang中github.com/google/cups-connector/lib.Config.LogMaxFiles方法的典型用法代碼示例。如果您正苦於以下問題:Golang Config.LogMaxFiles方法的具體用法?Golang Config.LogMaxFiles怎麽用?Golang Config.LogMaxFiles使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類github.com/google/cups-connector/lib.Config
的用法示例。
在下文中一共展示了Config.LogMaxFiles方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: updateConfig
func updateConfig(config *lib.Config, configMap map[string]interface{}) bool {
dirty := commonUpdateConfig(config, configMap)
if _, exists := configMap["log_file_name"]; !exists {
dirty = true
fmt.Println("Added log_file_name")
config.LogFileName = lib.DefaultConfig.LogFileName
}
if _, exists := configMap["log_file_max_megabytes"]; !exists {
dirty = true
fmt.Println("Added log_file_max_megabytes")
config.LogFileMaxMegabytes = lib.DefaultConfig.LogFileMaxMegabytes
}
if _, exists := configMap["log_max_files"]; !exists {
dirty = true
fmt.Println("Added log_max_files")
config.LogMaxFiles = lib.DefaultConfig.LogMaxFiles
}
if _, exists := configMap["log_to_journal"]; !exists {
dirty = true
fmt.Println("Added log_to_journal")
config.LogToJournal = lib.DefaultConfig.LogToJournal
}
if _, exists := configMap["monitor_socket_filename"]; !exists {
dirty = true
fmt.Println("Added monitor_socket_filename")
config.MonitorSocketFilename = lib.DefaultConfig.MonitorSocketFilename
}
if _, exists := configMap["cups_max_connections"]; !exists {
dirty = true
fmt.Println("Added cups_max_connections")
config.CUPSMaxConnections = lib.DefaultConfig.CUPSMaxConnections
}
if _, exists := configMap["cups_connect_timeout"]; !exists {
dirty = true
fmt.Println("Added cups_connect_timeout")
config.CUPSConnectTimeout = lib.DefaultConfig.CUPSConnectTimeout
}
if _, exists := configMap["cups_printer_attributes"]; !exists {
dirty = true
fmt.Println("Added cups_printer_attributes")
config.CUPSPrinterAttributes = lib.DefaultConfig.CUPSPrinterAttributes
} else {
// Make sure all required attributes are present.
s := make(map[string]struct{}, len(config.CUPSPrinterAttributes))
for _, a := range config.CUPSPrinterAttributes {
s[a] = struct{}{}
}
for _, a := range lib.DefaultConfig.CUPSPrinterAttributes {
if _, exists := s[a]; !exists {
dirty = true
fmt.Printf("Added %s to cups_printer_attributes\n", a)
config.CUPSPrinterAttributes = append(config.CUPSPrinterAttributes, a)
}
}
}
if _, exists := configMap["cups_job_full_username"]; !exists {
dirty = true
fmt.Println("Added cups_job_full_username")
config.CUPSJobFullUsername = lib.DefaultConfig.CUPSJobFullUsername
}
if _, exists := configMap["cups_ignore_raw_printers"]; !exists {
dirty = true
fmt.Println("Added cups_ignore_raw_printers")
config.CUPSIgnoreRawPrinters = lib.DefaultConfig.CUPSIgnoreRawPrinters
}
if _, exists := configMap["cups_ignore_class_printers"]; !exists {
dirty = true
fmt.Println("Added cups_ignore_class_printers")
config.CUPSIgnoreClassPrinters = lib.DefaultConfig.CUPSIgnoreClassPrinters
}
if _, exists := configMap["copy_printer_info_to_display_name"]; !exists {
dirty = true
fmt.Println("Added copy_printer_info_to_display_name")
config.CUPSCopyPrinterInfoToDisplayName = lib.DefaultConfig.CUPSCopyPrinterInfoToDisplayName
}
return dirty
}