Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

fixing the XML parsing for go1 and gofmt

  • Loading branch information...
commit 7649a69f927f662f2122a6c64caea2e1e934d0c1 1 parent cf19570
Scott White authored
View
3  file_writer.go
@@ -1,9 +1,10 @@
package timber
import (
- "os"
"fmt"
+ "os"
)
+
/* unbuffered impl
type FileWriter struct {
file io.WriteCloser
View
2  pattern_formatter_test.go
@@ -1,8 +1,8 @@
package timber
import (
- "testing"
"fmt"
+ "testing"
)
func TestWorstPatternFormat(t *testing.T) {
View
3  socket_writer.go
@@ -1,8 +1,8 @@
package timber
import (
- "net"
"fmt"
+ "net"
)
// This should write to anything that you can write to with net.Dial
@@ -27,6 +27,7 @@ func (sw *SocketWriter) LogWrite(msg string) {
func (sw *SocketWriter) Close() {
sw.conn.Close()
}
+
//************/
/*************
func NewSocketWriter(network, addr string) (LogWriter) {
View
22 xml_config.go
@@ -13,22 +13,22 @@ var LongLevelStrings = []string{"NONE", "FINEST", "FINE", "DEBUG", "TRACE", "INF
// match the log4go structure so i don't have to change my configs
type xmlProperty struct {
- Name string `xml:"attr"`
- Value string `xml:"chardata"`
+ Name string `xml:"name,attr"`
+ Value string `xml:",chardata"`
}
type xmlFilter struct {
- XMLName xml.Name `xml:"filter"`
- Tag string
- Enabled bool `xml:"attr"`
- Type string
- Level string
- Format xmlProperty
- Property []xmlProperty
+ XMLName xml.Name `xml:"filter"`
+ Tag string `xml:"tag"`
+ Enabled bool `xml:"enabled,attr"`
+ Type string `xml:"type"`
+ Level string `xml:"level"`
+ Format xmlProperty `xml:"format"`
+ Property []xmlProperty `xml:"property"`
}
type xmlConfig struct {
- XMLName xml.Name `xml:"logging"`
- Filter []xmlFilter
+ XMLName xml.Name `xml:"logging"`
+ Filter []xmlFilter `xml:"filter"`
}
// Loads the configuration from an XML file (as you were probably expecting)
Please sign in to comment.
Something went wrong with that request. Please try again.