6 changed files with 19 additions and 4 deletions

No files matched your search

+3 -2
View File
@@ -6,6 +6,7 @@ import (
"github.com/SommerEngineering/Ocean/Tools"
"net/url"
"sort"
"strings"
)
// Sign a message to secure it.
@@ -32,7 +33,7 @@ func signMessage(data map[string][]string) (result url.Values) {
// Now, loop over all the data:
for _, key := range keys {
// Get the value:
value := data[key]
value := data[key][0]
// Hash each key and value:
fmt.Fprintf(hash, "key=%s :: value=%s\n", key, value)
@@ -42,6 +43,6 @@ func signMessage(data map[string][]string) (result url.Values) {
result = url.Values(data)
// Append the sign:
result.Add(`checksum`, fmt.Sprintf("%x", hash.Sum(nil)))
result.Add(`checksum`, strings.ToUpper(fmt.Sprintf("%x", hash.Sum(nil))))
return
}
+7
View File
@@ -0,0 +1,7 @@
package Log
// This function provides the project name for e.g. logging events
// coming trough the ICCC.
func GetProjectName() string {
return projectName
}
+7 -1
View File
@@ -121,10 +121,16 @@ func clearEntry(entry Meta.Entry) (result Meta.Entry) {
// Remove white spaces from the parameters.
func clearParameters(oldParameters []string) (result []string) {
for n := 0; n < len(oldParameters); n++ {
// Remove white spaces:
oldParameters[n] = removeWhitespaces(oldParameters[n])
// Is content left after removing?
if oldParameters[n] != `` {
// Yes, some content is still there. Thus, commit this entry:
result = append(result, oldParameters[n])
}
}
result = oldParameters
return
}
+1
View File
@@ -30,6 +30,7 @@ func ICCCNewLogEventReceiver(data map[string][]string) (result map[string][]stri
// Provide a log entry:
logEntry := LM.Entry{}
logEntry.Project = Log.GetProjectName()
logEntry.Sender = LM.Sender(messageData.Sender)
logEntry.Category = LM.ParseCategory(messageData.Category)
logEntry.Level = LM.ParseLevel(messageData.Level)
BIN
View File
Binary file not shown.
+1 -1
View File
@@ -1,5 +1,5 @@
package Version
var (
oceansVersion string = `2.0.3` // Ocean's current version
oceansVersion string = `2.0.4` // Ocean's current version
)