阅 读 文 章

snakelets 文档,我翻译了一部分。

[来源:网上转载 (http://www.chinaunix.net) | 作者:网友(瘦青蛙) | 时间:2007-05-27 | 浏览:人次 ]


web请求日志(apache-style 访问日志)。默认日志文件”logs/access.log”。是 rotating 日志文件, 10次100Kb。Loglevle 设置为 ‘NOTSET’。如果设置为’CRITICAL’,没有访问日志处理(关闭日志处理可以改善性能)。

"Snakelets.logger.stdout" and "Snakelets.logger.stderr" are the logger adapters for the standard output and standard error messages. These messages are printed on the console but are also written to "logs/server_console.log"
用来纪录 标准输出 和 标准错误 信息。这些信息将被输出到控制台同时也被写入到 ‘logs/server_console.log’中。
[/list]

You can use the logging facility in your own code by doing: 
你可以很容易的通过如下代码使用logging:


import logging
log=logging.getLogger("Snakelets.logger")
log.debug("my debug message")


[size=18]User libraries / modules[/size]

If you want to use a library or module from within several webapps, you don't have to include it in every webapp directory. There is a special directory "userlibs" in which you can place your modules and packages that you want to install. Snakelets adds this directory to the module search path, so you can import anything in it in your webapps without using nasty prefixes.
如果你想在一些webapp中使用 库 或者 模块,你并不需要将他们include到每一个webapp目录中。这里有一个特殊的目录:”userlibs”,你可以放置你所需要的模块或者是package。Snakelets将此目录添加到检索路径中,你可以在任何webapp中直接调用他们从而避免使用令人厌恶的路径前缀。

You can also easily upgrade libraries this way, just put the new version in userlibs instead of the older version and all your webapps that import it will instantly use the new code the next time you start the server.
您可以将更新版本的 库 文件放入到 userlibs目录中来代替就版本,从而很容易的进行升级,server将在下一次启动的时候载入新的文件。

Snakelets manual - Back to index



 limodou 回复于:2005-06-16 20:47:52

非常好。我也对snakelets感兴趣,不过翻译文档总是很麻烦。其实我认为snaketlets现在缺少的是教程,如果可以不如写一些简单的开发教程。期待中。。。

BTW我认为frog是一个非常好的blog系统。


 xichen 回复于:2005-06-16 22:06:54

瘦青蛙,希望你能翻译和尝试更多的python项目和产品.来促进国内的python发展.相信大家都会感谢你的!
论坛热门帖子: [lch203] 写得蛮好的linux学习笔记(10-21)
[黑马制造] 学习java的30个目标(10-19)
[笑傲股林] 做测试半年了,有点迷茫,应该再学些什么提高自己的测试水平和测试能力呢?(10-19)
[udp8589] 大家用google的来吱一声? 用百度的~~也来报道下?(10-18)
[沂偌掳兆] 本人总结的一些认为C++比较经典的书籍,希望对大家有用(10-18)
TAG标签: 翻译 文档 使用 可以 页面 URL 如果 文件 webapp 一个

最新评论 共有1位网友发表了评论

发表评论

评论内容:不能超过250字,需审核,请自觉遵守互联网相关政策法规。
用户名:(注册)
密码:
验证码:
匿名发表

网站地图友情连接交流论坛网站投稿广告服务联系我们留言本站长统计
Some rights reserved: www.chmhome.com, 鄂ICP备07010232号 E-mail:chinakafei@live.com,QQ:552766
中国咖啡技术网(Chmhome):国外编程技术书籍,中文编程手册,经典编程文章,交流技术,技术软件下载,计算机论文,毕业论文.