blob: f1127674b073ea66fd81fffd77b59b49d408a113 [file] [log] [blame]
Don Newton7577f072020-01-06 12:41:11 -05001/*
2 Copyright 2017 the original author or authors.
3
4 Licensed under the Apache License, Version 2.0 (the "License");
5 you may not use this file except in compliance with the License.
6 You may obtain a copy of the License at
7
8 http://www.apache.org/licenses/LICENSE-2.0
9
10 Unless required by applicable law or agreed to in writing, software
11 distributed under the License is distributed on an "AS IS" BASIS,
12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 See the License for the specific language governing permissions and
14 limitations under the License.
15*/
16
17package settings
18
19var debug bool
20var debugMap = make(map[string]bool)
21
22func SetDebug(on bool) {
23 debug = on
24}
25
26func SetDeviceDebug(deviceId string, on bool) {
27 debugMap[deviceId] = on
28}
29func GetDebug(deviceId string) bool {
30 /*
31 if debug {
32 return true
33 }
34 return getDeviceDebug(deviceId)
35 */
36 return debug
37}
38func getDeviceDebug(deviceId string) bool {
39 //will return false if nothing has been added for that device
40 return debugMap[deviceId]
41}