Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
DeepSpeech
提交
0f27abcf
D
DeepSpeech
项目概览
PaddlePaddle
/
DeepSpeech
大约 2 年 前同步成功
通知
210
Star
8425
Fork
1598
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
245
列表
看板
标记
里程碑
合并请求
3
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
DeepSpeech
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
245
Issue
245
列表
看板
标记
里程碑
合并请求
3
合并请求
3
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
0f27abcf
编写于
12月 24, 2021
作者:
小湉湉
提交者:
GitHub
12月 24, 2021
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #1216 from KPatr1ck/cli_log
[CLI][S2T]Remove logging file in cli api.
上级
50e560b5
d362d28d
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
27 addition
and
11 deletion
+27
-11
paddlespeech/cli/log.py
paddlespeech/cli/log.py
+1
-2
paddlespeech/s2t/utils/log.py
paddlespeech/s2t/utils/log.py
+26
-9
未找到文件。
paddlespeech/cli/log.py
浏览文件 @
0f27abcf
...
...
@@ -43,8 +43,7 @@ class Logger(object):
level
)
self
.
format
=
logging
.
Formatter
(
fmt
=
'[%(asctime)-15s] [%(levelname)8s] [%(filename)s] [L%(lineno)d] - %(message)s'
)
fmt
=
'[%(asctime)-15s] [%(levelname)8s] - %(message)s'
)
self
.
handler
=
logging
.
StreamHandler
()
self
.
handler
.
setFormatter
(
self
.
format
)
...
...
paddlespeech/s2t/utils/log.py
浏览文件 @
0f27abcf
...
...
@@ -12,6 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import
getpass
import
inspect
import
os
import
socket
import
sys
...
...
@@ -94,6 +95,22 @@ def find_log_dir_and_names(program_name=None, log_dir=None):
class
Log
():
"""Default Logger for all."""
logger
.
remove
()
_call_from_cli
=
False
_frame
=
inspect
.
currentframe
()
while
_frame
:
if
'paddlespeech/cli/__init__.py'
in
_frame
.
f_code
.
co_filename
:
_call_from_cli
=
True
break
_frame
=
_frame
.
f_back
if
_call_from_cli
:
logger
.
add
(
sys
.
stdout
,
level
=
'ERROR'
,
enqueue
=
True
,
filter
=
lambda
record
:
record
[
'level'
].
no
>=
20
)
else
:
logger
.
add
(
sys
.
stdout
,
level
=
'INFO'
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录