forked from holochain/holochain-proto
/
change.go
39 lines (32 loc) · 981 Bytes
/
change.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
// Copyright (C) 2013-2017, The MetaCurrency Project (Eric Harris-Braun, Arthur Brock, et. al.)
// Use of this source code is governed by GPLv3 found in the LICENSE file
//----------------------------------------------------------------------------------------
// change implements adding of features to holochain such that deprecation and version dependency
// is knowable by app developers
package holochain
type ChangeType int8
const (
Deprecation ChangeType = iota
Warning
)
// Change represents a semantic change that needs to be reported
type Change struct {
Type ChangeType
Message string
AsOf int
}
func (c *Change) Log() {
var h string
switch c.Type {
case Deprecation:
h = "Deprecation warning: "
case Warning:
h = "Warning: "
}
Infof(h+c.Message, c.AsOf)
}
var ChangeAppProperty = Change{
Type: Warning,
Message: "Getting special properties via property() is deprecated as of %d. Returning nil values. Use App* instead",
AsOf: 3,
}