Skip to content

Commit

Permalink
v1.0.2
Browse files Browse the repository at this point in the history
Added godocs
Updated License
  • Loading branch information
Avdushin committed Dec 21, 2023
1 parent 07b0e7c commit 8c7814d
Show file tree
Hide file tree
Showing 12 changed files with 73 additions and 7 deletions.
12 changes: 12 additions & 0 deletions Examples/App_example/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,19 @@ import (
)

func main() {
// Init logger
log := utils.Logger()
// Print Debug log
log.Debug("Test message")
// Call Helper function from utils
utils.Helper("Emenem")

// Output:
// 2023/12/21 03:19:03 [INFO] Пример лога уровня INFO
// 2023/12/21 03:19:03 [DEBUG] Пример лога уровня DEBUG
// 2023/12/21 03:19:03 [WARNING] Пример лога уровня WARNING
// 2023/12/21 03:19:03 [ERROR] Пример лога уровня ERROR
// 2023/12/21 03:19:03 [INFO] Just Print INFO message
// 2023/12/21 03:19:03 [DEBUG] Test message
// 2023/12/21 03:19:03 [WARNING] Emenem
}
3 changes: 3 additions & 0 deletions Examples/App_example/utils/helper.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Tis package contains the utility functions
// Helper - a function that printing a Warnings message
// logger - a function that setups the logger
package utils

import "github.com/Avdushin/gogger/logger"
Expand Down
3 changes: 3 additions & 0 deletions Examples/App_example/utils/logger.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Tis package contains the utility functions
// Helper - a function that printing a Warnings message
// logger - a function that setups the logger
package utils

import (
Expand Down
24 changes: 24 additions & 0 deletions Examples/App_example/utils/utils_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package utils_test

import (
"github.com/Avdushin/gogger/Examples/App_example/utils"
)

func ExampleHelper() {
utils.Helper("emenem")

// Output:
// 2023/12/21 03:19:03 [WARNING] Emenem
}

func ExampleLoggger() {
utils.Logger()

// Output:
// 2023/12/21 03:28:42 [INFO] Пример лога уровня INFO
// 2023/12/21 03:28:42 [DEBUG] Пример лога уровня DEBUG
// 2023/12/21 03:28:42 [WARNING] Пример лога уровня WARNING
// 2023/12/21 03:28:42 [ERROR] Пример лога уровня ERROR
// 2023/12/21 03:28:42 [INFO] Just Print INFO message
// 2023/12/21 03:28:42 [DEBUG] Test message
}
14 changes: 14 additions & 0 deletions Examples/logfile/logfile.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,18 @@ func main() {
log.Warning("Пример лога уровня WARNING")
log.Error("Пример лога уровня ERROR")
log.Print("Just Print INFO message")

// Output:
// 2023/12/21 03:08:59 [INFO] Пример лога уровня INFO
// 2023/12/21 03:08:59 [DEBUG] Пример лога уровня DEBUG
// 2023/12/21 03:08:59 [WARNING] Пример лога уровня WARNING
// 2023/12/21 03:08:59 [ERROR] Пример лога уровня ERROR
// 2023/12/21 03:08:59 [INFO] Just Print INFO message
//
// Files Tree:
// .
// ├── dayly_logs.go
// └── logs
// └── logs.log

}
10 changes: 5 additions & 5 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
MIT License
The MIT License (MIT)

Copyright (c) 2023 Avdushin

Expand All @@ -9,13 +9,13 @@ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@ go get -u github.com/Avdushin/gogger/logger
go get -u github.com/Avdushin/gogger/lib
```

## Documentation

```bash
go install golang.org/x/tools/cmd/godoc@latest
godoc -http :8080
```

## Examples

### Init logger
Expand Down
3 changes: 1 addition & 2 deletions gogger/Version.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
// Copyright 2023 Gogger Core Team. All rights reserved.
// Use of this source code is governed by a MIT style
// license that can be found in the LICENSE file.

package gogger

// Version is the current gogger logger version.
const Version = "v1.0.1"
const Version = "v1.0.2"
1 change: 1 addition & 0 deletions lib/Writer.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package lib

// This is a writer function
func (l *Logger) Write(p []byte) (n int, err error) {
l.mu.Lock()
defer l.mu.Unlock()
Expand Down
1 change: 1 addition & 0 deletions lib/logger.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// The lib package contains core functionality of the Gogger
package lib

import (
Expand Down
1 change: 1 addition & 0 deletions logger/InitLogger.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// The logger package contains the implementation of core logging methods
package logger

import (
Expand Down
1 change: 1 addition & 0 deletions logger/logger.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// The logger package contains the implementation of core logging methods
package logger

import "github.com/Avdushin/gogger/lib"
Expand Down

0 comments on commit 8c7814d

Please sign in to comment.