Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
eshiled-new
/
funasr_web
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit b0f253fe
authored
Mar 20, 2024
by
‘chizw’
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
日志路径优化
1 parent
9b7c3931
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
1 deletions
kafka_service/funasr_producer.py
log/logger.py
kafka_service/funasr_producer.py
View file @
b0f253f
...
@@ -9,7 +9,6 @@ from mysql_service import funasr_db
...
@@ -9,7 +9,6 @@ from mysql_service import funasr_db
# 创建Kafka生产者
# 创建Kafka生产者
producer
=
KafkaProducer
(
bootstrap_servers
=
ConfigInfo
.
kafka_consumer_bootstrap_servers
)
# Kafka集群的地址
producer
=
KafkaProducer
(
bootstrap_servers
=
ConfigInfo
.
kafka_consumer_bootstrap_servers
)
# Kafka集群的地址
# key = b"funasr-key" # 消息的键(可选)
# key = b"funasr-key" # 消息的键(可选)
# 关闭生产者
# 关闭生产者
# producer.close()
# producer.close()
...
...
log/logger.py
View file @
b0f253f
import
logging
import
logging
import
os
import
os
import
sys
import
sys
# 获取当前文件所在目录的绝对路径
current_dir
=
os
.
path
.
dirname
(
os
.
path
.
abspath
(
__file__
))
# 将根目录添加到 Python 解释器的搜索路径中
root_dir
=
os
.
path
.
join
(
current_dir
,
'..'
)
# 假设根目录是当前目录的父目录
sys
.
path
.
append
(
root_dir
)
from
logging.handlers
import
TimedRotatingFileHandler
from
logging.handlers
import
TimedRotatingFileHandler
def
setup_logging
(
log_file
):
def
setup_logging
(
log_file
):
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment