mirror of
https://code.forgejo.org/forgejo/runner.git
synced 2025-10-10 19:32:04 +00:00
--watch
This commit is contained in:
parent
57490858a1
commit
5bffacf271
17 changed files with 1071 additions and 19 deletions
33
vendor/github.com/andreaskoch/go-fswatch/debug.go
generated
vendored
Normal file
33
vendor/github.com/andreaskoch/go-fswatch/debug.go
generated
vendored
Normal file
|
@ -0,0 +1,33 @@
|
|||
// Copyright 2013 Andreas Koch. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package fswatch
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
)
|
||||
|
||||
var (
|
||||
debugIsEnabled = false
|
||||
debugMessages chan string
|
||||
)
|
||||
|
||||
func EnableDebug() chan string {
|
||||
debugIsEnabled = true
|
||||
debugMessages = make(chan string, 10)
|
||||
return debugMessages
|
||||
}
|
||||
|
||||
func DisableDebug() {
|
||||
debugIsEnabled = false
|
||||
close(debugMessages)
|
||||
}
|
||||
|
||||
func log(format string, v ...interface{}) {
|
||||
if !debugIsEnabled {
|
||||
return
|
||||
}
|
||||
|
||||
debugMessages <- fmt.Sprint(fmt.Sprintf(format, v...))
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue