Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
L
lcc-akm
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wangmingming
lcc-akm
Commits
c58a1590
Commit
c58a1590
authored
Mar 22, 2023
by
王明明
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改日志区分
parent
3359d2e6
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
4 deletions
+8
-4
main.go
src/main.go
+6
-2
run.sh
src/run.sh
+2
-2
No files found.
src/main.go
View file @
c58a1590
package
main
package
main
import
(
import
(
"flag"
"fmt"
"fmt"
nested
"github.com/antonfisher/nested-logrus-formatter"
nested
"github.com/antonfisher/nested-logrus-formatter"
"github.com/gorilla/mux"
"github.com/gorilla/mux"
...
@@ -18,6 +19,8 @@ func WelcomeHandler(w http.ResponseWriter, r *http.Request) {
...
@@ -18,6 +19,8 @@ func WelcomeHandler(w http.ResponseWriter, r *http.Request) {
}
}
func
main
()
{
func
main
()
{
logname
:=
flag
.
String
(
"logname"
,
"akm.log"
,
"日志文件名"
)
flag
.
Parse
()
logrus
.
SetLevel
(
logrus
.
TraceLevel
)
logrus
.
SetLevel
(
logrus
.
TraceLevel
)
//logrus.SetFormatter(&logrus.TextFormatter{
//logrus.SetFormatter(&logrus.TextFormatter{
// //HideKeys: true,
// //HideKeys: true,
...
@@ -31,9 +34,10 @@ func main() {
...
@@ -31,9 +34,10 @@ func main() {
NoColors
:
true
,
NoColors
:
true
,
})
})
logFilePath
:=
util
.
GetCurrentAbPathByCaller
()
logFilePath
:=
util
.
GetCurrentAbPathByCaller
()
logFileName
:=
"akm.log"
logFileName
:=
*
logname
fileName
:=
path
.
Join
(
logFilePath
,
logFileName
)
fileName
:=
path
.
Join
(
logFilePath
,
logFileName
)
fmt
.
Println
(
"日志文件路径 "
,
fileName
)
// 写入文件
// 写入文件
//src, err := os.OpenFile(fileName+".log", os.O_APPEND|os.O_WRONLY|os.O_CREATE, os.ModeAppend)
//src, err := os.OpenFile(fileName+".log", os.O_APPEND|os.O_WRONLY|os.O_CREATE, os.ModeAppend)
...
...
src/run.sh
View file @
c58a1590
export
GOPROXY
=
https://goproxy.cn
export
GOPROXY
=
https://goproxy.cn
cd
/root/src/js
&&
npm i
&&
nohup
/usr/local/bin/node
--expose-gc
--max-old-space-size
=
256
--max-new-space-size
=
1024 run.js
>
1.log 2>&1 &
cd
/root/src/js
&&
npm i
&&
nohup
/usr/local/bin/node
--expose-gc
--max-old-space-size
=
256 run.js
>
1.log 2>&1 &
cd
/root/src
&&
go run main.go
cd
/root/src
&&
go run main.go
--logname
=
$logname
\ No newline at end of file
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment