refactor: renamed golog to log
This commit is contained in:
parent
b44771fddb
commit
0819e83691
14 changed files with 20 additions and 18 deletions
10
README.md
10
README.md
|
@ -1,11 +1,11 @@
|
|||
# goLog
|
||||
# log
|
||||
|
||||
GoLog is a simple logging framework for golang.
|
||||
Log is a simple logging framework for golang.
|
||||
|
||||
## Getting Started
|
||||
|
||||
```golang
|
||||
import log "gitlab.com/martinr92/golog"
|
||||
import "git.martin-riedl.de/golang/log"
|
||||
|
||||
func main(){
|
||||
log.Default.Info("My First Info Message")
|
||||
|
@ -17,7 +17,7 @@ func main(){
|
|||
Create a new log instance (instead of using the `Default`).
|
||||
|
||||
```golang
|
||||
import log "gitlab.com/martinr92/golog"
|
||||
import "git.martin-riedl.de/golang/log"
|
||||
|
||||
var myLog := log.NewLoggerDefault()
|
||||
myLog.Info("My First Info Message")
|
||||
|
@ -32,7 +32,7 @@ myLog.Info("My First Info Message")
|
|||
The following sample creates 2 outputs. The first sends a key/value format to stdout. The second writes messages as JSON format to stdout.
|
||||
|
||||
```golang
|
||||
import log "gitlab.com/martinr92/golog"
|
||||
import "git.martin-riedl.de/golang/log"
|
||||
|
||||
var output1 := NewOutput(log.LevelInfo, NewFormatterKeyValue(), NewPrinterStdout()
|
||||
var output2 := NewOutput(log.LevelError, NewFormatterJSON(), NewPrinterStdout())
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
log "gitlab.com/martinr92/golog"
|
||||
"git.martin-riedl.de/golang/log"
|
||||
"runtime"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
@ -10,4 +11,5 @@ func main() {
|
|||
|
||||
func someMethod() {
|
||||
log.Default.Info("Hello World")
|
||||
log.Default.With("os", runtime.GOOS).Info("environment detected")
|
||||
}
|
||||
|
|
2
entry.go
2
entry.go
|
@ -12,7 +12,7 @@
|
|||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package golog
|
||||
package log
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package golog
|
||||
package log
|
||||
|
||||
type Formatter interface {
|
||||
Begin(*Entry)
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package golog
|
||||
package log
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package golog
|
||||
package log
|
||||
|
||||
import "testing"
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package golog
|
||||
package log
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package golog
|
||||
package log
|
||||
|
||||
import "testing"
|
||||
|
||||
|
|
2
go.mod
2
go.mod
|
@ -1,3 +1,3 @@
|
|||
module gitlab.com/martinr92/golog
|
||||
module git.martin-riedl.de/golang/log
|
||||
|
||||
go 1.20
|
||||
|
|
2
level.go
2
level.go
|
@ -12,7 +12,7 @@
|
|||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package golog
|
||||
package log
|
||||
|
||||
type Level uint32
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package golog
|
||||
package log
|
||||
|
||||
import (
|
||||
"runtime"
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package golog
|
||||
package log
|
||||
|
||||
import "sync"
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package golog
|
||||
package log
|
||||
|
||||
type Printer interface {
|
||||
Write(p []byte)
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package golog
|
||||
package log
|
||||
|
||||
import "os"
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue