mirror of
https://github.com/gusaul/grpcox.git
synced 2025-04-22 14:25:37 +00:00
fix panic when folder log not exists
This commit is contained in:
parent
f240d0494e
commit
40bca6e2af
|
@ -15,6 +15,11 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
// create folder "log" if not exists
|
||||||
|
if _, err := os.Stat("log"); os.IsNotExist(err) {
|
||||||
|
os.Mkdir("log", os.ModePerm)
|
||||||
|
}
|
||||||
|
|
||||||
// logging conf
|
// logging conf
|
||||||
f, err := os.OpenFile("log/grpcox.log", os.O_RDWR|os.O_CREATE|os.O_APPEND, 0666)
|
f, err := os.OpenFile("log/grpcox.log", os.O_RDWR|os.O_CREATE|os.O_APPEND, 0666)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user