-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Release version
- Loading branch information
Showing
28 changed files
with
551 additions
and
299 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,11 @@ | ||
package main | ||
|
||
import ( | ||
"github.com/Avdushin/gogger/Examples/App_example/helpers/logger" | ||
"github.com/Avdushin/gogger/Examples/App_example/utils" | ||
) | ||
|
||
func main() { | ||
logger.Info("App started...") | ||
logger.Debug("App started...") | ||
logger.Warning("App started...") | ||
logger.Error("App started...") | ||
} | ||
|
||
func init() { | ||
logger.InitLogger() | ||
log := utils.Logger() | ||
log.Debug("Test message") | ||
utils.Helper("Emenem") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package utils | ||
|
||
import "github.com/Avdushin/gogger/logger" | ||
|
||
func Helper(name string) { | ||
logger.Warning(name) | ||
} |
12 changes: 8 additions & 4 deletions
12
Examples/logLevelFile/logLevelFile.go → Examples/App_example/utils/logger.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,20 @@ | ||
package main | ||
package utils | ||
|
||
import ( | ||
"github.com/Avdushin/gogger/lib" | ||
"github.com/Avdushin/gogger/logger" | ||
) | ||
|
||
func main() { | ||
// Создаем новый логгер с директорией, в которой будут храниться файлы логов | ||
log := logger.New(logger.DEBUG, "logs/logs.log") | ||
func Logger() *lib.Logger { | ||
// Запись в файл logs/logs.log | ||
log := logger.InitLogger("logs/logs.log") | ||
|
||
// Пример использования логгера | ||
log.Info("Пример лога уровня INFO") | ||
log.Debug("Пример лога уровня DEBUG") | ||
log.Warning("Пример лога уровня WARNING") | ||
log.Error("Пример лога уровня ERROR") | ||
log.Print("Just Print INFO message") | ||
|
||
return log | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package main | ||
|
||
import "github.com/Avdushin/gogger/logger" | ||
|
||
var ( | ||
libName = "gogger" | ||
) | ||
|
||
func main() { | ||
// Запись в файл logs/logs.log | ||
log := logger.InitLogger("logs/logs.log") | ||
|
||
// Пример использования логгера | ||
log.Info("Пример лога уровня INFO") | ||
log.Debug("Пример лога уровня DEBUG") | ||
log.Warning("Пример лога уровня WARNING") | ||
log.Error("Пример лога уровня ERROR") | ||
log.Print("Just Print INFO message") | ||
|
||
log.Debug("You using %s logger for logging messages in this project!", libName) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package utils | ||
|
||
import "github.com/Avdushin/gogger/logger" | ||
|
||
func Helper(name string) { | ||
logger.Debug(name) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,15 @@ | ||
package main | ||
|
||
import ( | ||
"github.com/Avdushin/gogger/logger" | ||
) | ||
import "github.com/Avdushin/gogger/logger" | ||
|
||
func main() { | ||
// Создаем новый логгер с директорией, в которой будут храниться файлы логов | ||
log := logger.New("logs/logs.log") | ||
// Запись в файл logs/logs.log | ||
log := logger.InitLogger("logs/logs.log") | ||
|
||
// Пример использования логгера | ||
log.Info("Пример лога уровня INFO") | ||
log.Debug("Пример лога уровня DEBUG") | ||
log.Warning("Пример лога уровня WARNING") | ||
log.Error("Пример лога уровня ERROR") | ||
log.Print("Just Print INFO message") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.