-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.go
61 lines (50 loc) · 1.37 KB
/
config.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
package poneglyph
// Log configs
var (
projectName string
isPrintRelativeFromContentRoot bool
isPrintFunctionName bool
isUseSimpleFunctionName bool
isPrintNewline bool
isUseTabSeparator bool
isSkipNonProject bool
stackLimit int
)
// TODO: set config should only be called once
func SetConfig(config Config) {
projectName = config.projectName
isPrintRelativeFromContentRoot = config.isPrintRelativeFromContentRoot
isPrintFunctionName = config.isPrintFunctionName
isUseSimpleFunctionName = config.isUseSimpleFunctionName
isPrintNewline = config.isPrintNewline
isUseTabSeparator = config.isUseTabSeparator
isSkipNonProject = config.isSkipNonProject
stackLimit = config.stackLimit
}
func init() {
stackLimit = 100
}
func SetProjectName(name string) {
projectName = name
}
func SetIsPrintFromContentRoot(isPrint bool) {
isPrintRelativeFromContentRoot = isPrint
}
func SetIsPrintFunctionName(isPrint bool) {
isPrintFunctionName = isPrint
}
func SetIsPrintNewline(isPrint bool) {
isPrintNewline = isPrint
}
func SetIsUseSimpleFunctionName(isUse bool) {
isUseSimpleFunctionName = isUse
}
func SetIsUseTabSeparator(isUse bool) {
isUseTabSeparator = isUse
}
func SetIsSkipNonProject(isSkip bool) {
isSkipNonProject = isSkip
}
func SetStackLimit(limit int) {
stackLimit = limit
}