python日志模块_使用Python打印日志-日志记录模块

python日志模块

In this tutorial, we will learn what is logging? (basics of logging), how we can print logs in python and the different log levels that should be used while printing logs.

在本教程中,我们将学习什么是日志记录? (日志记录的基础知识),我们如何在python中打印日志以及在打印日志时应使用的不同日志级别

First of all, let us discuss what is logging.

首先,让我们讨论什么是日志记录。

什么是日志记录? (What is Logging?)

Logging is basically a way to track events(what is happening) whenever any program/script runs. Logging calls are added by software developers in their software to print useful steps during software code execution along with some information which can be later used to track down the code execution.

日志基本上是一种在任何程序/脚本运行时跟踪事件(正在发生的事情)的方法 。 记录调用由软件开发人员在其软件中添加,以在软件代码执行期间打印有用的步骤以及一些信息,这些信息以后可用于跟踪代码执行。

  • Proper logging can help you develop a better understanding of the flow of the program and it is very helpful in discovering those scenarios which you may have not thought at about during development.

    正确的日志记录可以帮助您更好地理解程序的流程,并且对于发现开发过程中可能没有想到的方案非常有帮助

  • Logging is very in debugging issues.

    日志记录非常涉及调试问题。

  • With the help of Logs, developers get an extra set of eyes to look at the flow of the application. Logs can store information, like which user ID or IP which is accessing the application.

    在Logs的帮助下,开发人员可以有更多的眼光来查看应用程序的流程。 日志可以存储信息,例如正在访问应用程序的用户ID或IP

  • By logging useful data and metrics in the software application, you can not only debug errors easily but you can also use the data to analyze the performance of the application to plan for scaling.

    通过在软件应用程序中记录有用的数据指标 ,您不仅可以轻松调试错误,还可以使用数据来分析应用程序的性能以计划扩展。

  • An event is described as a descriptive message which can optionally contain variable data (i.e. data is mainly different for each occurrence of the event).

    事件被描述为描述性消息 ,可以可选地包含可变数据 (即,每次发生事件时数据主要不同)。

  • Events or Logs printed, also have an importance also known as Log level, which we will cover in the later section of this tutorial.

    事件或日志的打印也很重要,也称为Log level ,我们将在本教程的后面部分中介绍。

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值