Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
lichenggang
/
web_log
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
15cf07b0
authored
Dec 31, 2020
by
lichenggang
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
用户自行配置
parent
1d972ac5
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
2 deletions
config/config.go
main.go
config/config.go
View file @
15cf07b0
...
...
@@ -21,7 +21,7 @@ func GetCurrentPath() string {
func
InitConfig
()
{
flag
.
StringVar
(
&
Directory
,
"dir"
,
"/data/inotify_logs"
,
"监听目录"
)
flag
.
StringVar
(
&
Port
,
"port"
,
"9997"
,
"监听端口"
)
flag
.
Parse
()
Directory
=
"E:
\\
test_logs"
// directory of the log
logenv
:=
os
.
Getenv
(
"GOLOGENV"
)
if
logenv
==
"TEST"
{
...
...
main.go
View file @
15cf07b0
...
...
@@ -9,9 +9,10 @@ import (
// example
func
main
()
{
addrs
:=
"0.0.0.0:"
+
config
.
Port
config
.
InitConfig
()
addrs
:=
"0.0.0.0:"
+
config
.
Port
fmt
.
Printf
(
"查看日志目录: %s
\n
用户配置文件: %s"
,
config
.
Directory
,
config
.
UserConfigPath
)
app
:=
code
.
GetApp
(
config
.
Directory
)
app
.
Run
(
iris
.
Addr
(
addrs
),
iris
.
WithCharset
(
"UTF-8"
))
...
...
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