Skip to content

Commit

Permalink
Add missing comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
edoger committed Dec 3, 2021
1 parent 8e2d77d commit eddc640
Show file tree
Hide file tree
Showing 5 changed files with 72 additions and 2 deletions.
14 changes: 14 additions & 0 deletions console_formatter.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
// Copyright 2020 The ZKits Project Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package logger

import (
Expand Down
18 changes: 16 additions & 2 deletions console_formatter_caller_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
// Copyright 2020 The ZKits Project Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package logger

import (
Expand All @@ -14,9 +28,9 @@ func TestConsoleFormatter_Format_WithoutCaller(t *testing.T) {
buf := new(bytes.Buffer)
l.SetOutput(buf)

l.WithField("foo", 1).WithCaller().Trace("test") // LINE 17
l.WithField("foo", 1).WithCaller().Trace("test") // LINE 31
fmt.Println(buf.String())
want := "[TIME][\u001B[36mTAC\u001B[0m] test console_formatter_caller_test.go:17 foo=1\n"
want := "[TIME][\u001B[36mTAC\u001B[0m] test console_formatter_caller_test.go:31 foo=1\n"
if want != buf.String() {
t.Fatalf("NewConsoleFormatter().Format(): %s", strconv.Quote(buf.String()))
}
Expand Down
14 changes: 14 additions & 0 deletions console_formatter_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
// Copyright 2020 The ZKits Project Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package logger

import (
Expand Down
14 changes: 14 additions & 0 deletions multi_writer.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
// Copyright 2020 The ZKits Project Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package logger

import (
Expand Down
14 changes: 14 additions & 0 deletions multi_writer_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
// Copyright 2020 The ZKits Project Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package logger

import (
Expand Down

0 comments on commit eddc640

Please sign in to comment.