Giter VIP home page Giter VIP logo

seriouspresent's Introduction

SeriousPresent

An RPG game using Panda3D engine

日志模块

日志模块的名称是 serious_log,主要用来在需要的地方增加自己需要调试的信息。 发布前在每个函数的开始和结束出增加日志输出语句,以便在游戏过程中记录信息,以防游戏崩溃时可以查找问题来源。

具体用法

import serious_log

log = serious_log.SeriousLog('testlog.dat')
log.log('debug','test')

以这个代码为例,引入模块,新建一个SeriousLog对象的实例,传进去的参数就是希望写入的日志文件的名称。 调用log方法,第一个参数是错误等级,第二个参数是希望打印的信息。 最后的结果会是这样:

2016-06-20 16:42:15,049 - serious_log.py:30 - debug - test

会显示该段代码运行的时间,运行的文件名称(调用该log的文件),错误等级,以及希望显示出来的信息。

seriouspresent's People

Contributors

arlena avatar huanhuanhuan avatar huiresurgeran avatar shengcn avatar workingxxx avatar yanghaohehe avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.