怎样可以知道一个应用的编程语言排行榜2018

可以用firebug或者chrome的工具来查看网页的Response Headers:Response HeadersHTTP/1.1 200 OK Date: Thu, 29 Nov :16 GMT Server: Apache/2.2.15 (CentOS) X-Powered-By: PHP/5.2.17 Connection: close Transfer-Encoding: chunked Content-Type: text/ charset=UTF-8
声明:本文内容由互联网用户自发贡献自行上传,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任。如果您发现有涉嫌版权的内容,欢迎发送邮件至: 进行举报,并提供相关证据,工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。请问如何查看一个应用程序是哪种语言编写的呢?
[问题点数:20分,结帖人shenlong2006]
本版专家分:0
结帖率 100%
CSDN今日推荐
本版专家分:3145
本版专家分:2478
本版专家分:387348
2017年 总版技术专家分年内排行榜第一
2014年 总版技术专家分年内排行榜第二
2013年 总版技术专家分年内排行榜第三
2012年 总版技术专家分年内排行榜第七
本版专家分:14562
本版专家分:799
匿名用户不能发表回复!|
CSDN今日推荐Apply for Financial AidProgramming Languages, Part AUniversity of WashingtonAbout this course: This course is an introduction to the basic concepts of programming languages, with a strong emphasis on functional programming. The course uses the languages ML, Racket, and Ruby as vehicles for teaching the concepts, but the real intent is to teach enough about how any language “fits together” to make you more effective programming in any language -- and in learning new ones.
This course is neither particularly theoretical nor just about programming specifics -- it will give you a framework for understanding how to use language constructs effectively and how to design correct and elegant programs. By using different languages, you will learn to think more deeply than in terms of the particular syntax of one language. The emphasis on functional programming is essential for learning how to write robust, reusable, composable, and elegant programs. Indeed, many of the most important ideas in modern languages have their roots in functional programming. Get ready to learn a fresh and beautiful way to look at software and how to have fun building it.
The course assumes some prior experience with programming, as described in more detail in the first module.
The course is divided into three Coursera courses: Part A, Part B, and Part C.
As explained in more detail in the first module of Part A, the overall course is a substantial amount of challenging material, so the three-part format provides two intermediate milestones and opportunities for a pause before continuing.
The three parts are designed to be completed in order and set up to motivate you to continue through to the end of Part C.
The three parts are not quite equal in length: Part A is almost as substantial as Part B and Part C combined.
Week 1 of Part A has a more detailed list of topics for all three parts of the course, but it is expected that most course participants will not (yet!) know what all these topics mean.Who is this class for: The course assumes students are familiar with programming covered by most introductory courses, but it is explicitly designed not to be a particularly advanced course. Students should be comfortable with variables, conditionals, arrays, linked lists, stacks, and recursion (though recursion will be reviewed and expanded upon), and the difference between an interface and an implementation. Students should be eager to write programs in languages new to them. Part C of the course analyzes basic object-oriented concepts and contrast them with those of other languages, so familiarity with Java or a closely related language (e.g., C#) might be helpful for Part C, but it is not necessary for the assignments.
This course is based on a course designed for second- and third-year undergraduates: not a first computer science course, but not an advanced course either. So it certainly will not cover everything in the beautiful world of programming languages, but it is a solid introduction.
It is designed to be eye-opening and fascinating both for learners seeking a &third or fourth programming course& and for learners with more experience who are looking for a clear and precise foundation in programming languages.
The assignments in the course are designed to be challenging, but with everything you need in the course content.
An introductory video and another reading discuss assumed background in some more detail in Week 1 of the course.How To PassPass all graded assignments to complete the course.User Ratings4.9 starsAverage User Rating 4.9SyllabusWelcome! Start here!
Learn about this course and how it's organized.7 videos, 5 readingsexpandReading: Start here!Video: Optional: Who I Am / AcknowledgmentsVideo: What the Course is About / Initial MotivationVideo: Recommended BackgroundVideo: Why Part A, Part B, Part CVideo: Grading PolicyVideo: Optional: Very High-Level OutlineReading: About the CourseReading: Some More Perspective on Recommended BackgroundReading: Why are there 3 courses (Part A, Part B, Part C)?Reading: Grading Policy DetailsDiscussion Prompt: Discussion Forums: Why Are You Participating?This module contains two things: (1) The information for the [unusual] software you need to install for Programming Languages Part A. (2) An optional &fake& homework that you can turn in for auto-grading and peer assessment to get used to the mechanics of assignment turn-in that we will use throughout the course. You can do this module either before or after watching the first few &actual course content& videos in the next module, but you will want to get the software installed soon so you can learn by actively trying out variations on the code in the videos.
You will need to install the software to do the homework.4 videos, 3 readingsexpandReading: Part A Software Installation and Use: SML and EmacsReading: Why Emacs? (Optional)Video: Emacs installationVideo: SML installationVideo: SML Mode installationUngraded Programming: Homework 0 (Auto-Grader)Reading: Homework 0 Detailed Peer-Assessment InstructionsPeer Review: Homework 0 (Peer Assessment) It's time to dive in!
Start with a careful reading of the &Section 1 Welcome Message& and go from there.17 videos, 6 readingsexpandReading: Section 1 Welcome MessageReading: Section 1 Reading NotesReading: Code Files for All Section 1 VideosVideo: Rules for ExpressionsVideo: The REPL and ErrorsVideo: ShadowingVideo: Functions InformallyVideo: Functions FormallyVideo: Pairs and Other TuplesVideo: Introducing ListsVideo: List FunctionsVideo: Let ExpressionsVideo: Nested FunctionsVideo: Let and EfficiencyVideo: OptionsVideo: Booleans and Comparison OperationsVideo: Benefits of No MutationVideo: Optional: Java MutationVideo: Pieces of a LanguageReading: Homework 1 Detailed Guidelines for Peer AssessmentReading: Hints and Gotchas for Homework 1Reading: Extra Practice ProblemsGraded: Homework 1 (Auto-Grader)Graded: Homework 1This section is a particularly rewarding one where a lot of ideas come together to reveal a surprisingly elegant underlying structure in ML.
As usual, start with the welcome reading, dive into the material, and leave plenty of time to approach the programming assignment methodically.22 videos, 6 readingsexpandReading: Section 2 Welcome MessageReading: Section 2 Reading NotesReading: Code Files for All Section 2 VideosVideo: RecordsVideo: Tuples as Syntactic SugarVideo: Datatype BindingsVideo: Case ExpressionsVideo: Useful DatatypesVideo: Pattern Matching So FarVideo: Another Expression ExampleVideo: Type SynonymsVideo: Lists and Options are DatatypesVideo: Polymorphic DatatypesVideo: Each of Pattern Matching / Truth About FunctionsVideo: A Little Type InferenceVideo: Polymorphic and Equality TypesVideo: Nested PatternsVideo: More Nested PatternsVideo: Nested Patterns PreciselyVideo: Optional: Function PatternsVideo: ExceptionsVideo: Tail RecursionVideo: Accumulators for Tail RecursionVideo: Perspective on Tail RecursionReading: Homework 2 Detailed Guidelines for Peer AssessmentReading: Hints and Gotchas for Homework 2Reading: Extra Practice ProblemsGraded: Homework 2Graded: Homework 2This section is all about higher-order functions -- the feature that gives functional programming much of its expressiveness and elegance -- and its name!
As usual, the first reading below introduces you to the section, but it will make more sense once you dive in to the lectures.
Also be sure not to miss the material on course motivation that we have put in a &lesson& between the other videos for this week and the homework assignment.
The material is &optional& in the sense that it is not needed for the homeworks or next week's exam, but it is still very highly encouraged to better understand why the course (including Parts B and C) covers what it does and, hopefully, will change the way you look at software forever.
28 videos, 6 readingsexpandReading: Section 3 Welcome MessageReading: Section 3 Reading NotesReading: Code Files for All Section 3 VideosVideo: Functions as ArgumentsVideo: Polymorphic Types and Functions as ArgumentsVideo: Anonymous FunctionsVideo: Unnecessary Function WrappingVideo: Map and FilterVideo: Generalizing Prior TopicsVideo: Lexical ScopeVideo: Lexical Scope and Higher-Order FunctionsVideo: Why Lexical ScopeVideo: Closures and RecomputationVideo: Fold and More ClosuresVideo: Closure Idiom: Combining FunctionsVideo: Closure Idiom: CurryingVideo: Partial ApplicationVideo: Currying WrapupVideo: Mutable ReferencesVideo: Closure Idiom: CallbacksVideo: Standard-Library DocumentationVideo: Optional: Abstract Data Types With ClosuresVideo: Optional: Closure Idioms Without ClosuresVideo: Optional: Java Without ClosuresVideo: Optional: C Without ClosuresVideo: Course-Motivation IntroductionVideo: Why Study General PL Concepts?Video: Are All PLs the Same?Video: Why Functional Languages?Video: Why ML, Racket, and Ruby?Reading: Homework 3 Detailed Guidelines for Peer AssessmentReading: Hints and Gotchas for Section 3Reading: Extra Practice ProblemsGraded: Homework 3Graded: Homework 3We finish Part A of the course with this module.
As explained in more detail in the welcome message, we discuss type inference, ML's module system, and the fundamental idea in computing of two computations being equivalent.
There is no programming assignment -- instead there is an exam covering all of Part A.
Finally, there is a brief wrap-up video for the end of Part A that also looks ahead to Part B and Part C -- we have put it after the exam, so don't overlook it.19 videos, 5 readings, 1 practice quizexpandReading: Section 4 Welcome MessageReading: Section 4 Reading NotesReading: Code Files for All Section 4 VideosVideo: What is Type InferenceVideo: ML Type InferenceVideo: Type Inference ExamplesVideo: Polymorphic ExamplesVideo: Optional: The Value Restriction and
Other Type-Inference ChallengesVideo: Mutual RecursionVideo: Modules for Namespace ManagementVideo: Signatures and Hiding ThingsVideo: A Module ExampleVideo: Signatures for Our ExampleVideo: Signature MatchingVideo: An Equivalent StructureVideo: Another Equivalent StructureVideo: Different Modules Define Different TypesVideo: Equivalent FunctionsVideo: Standard EquivalencesVideo: Equivalence Versus PerformanceReading: Nothing (yet) (explanation)Reading: Information About the Exam (Required Reading)Practice Quiz: Practice Exam for Part AVideo: Part A Wrap-Up & Parts B&C PreviewGraded: Exam for Part AFAQsWhen will I have access to the lectures and assignments?What if I need additional time to complete the course?What will I get if I pay for this course?Can I take this course for free?What is the refund policy?Is financial aid available?How It WorksCreatorsFounded in 1861, the University of Washington is one of the oldest state-supported institutions of higher education on the West Coast and is one of the preeminent research universities in the world.Ratings and ReviewsYou May Also LikePrinceton UniversityAlgorithms, Part IAlgorithms, Part IView coursePrinceton UniversityAlgorithms, Part IIAlgorithms, Part IIView courseUniversity of California San Diego, National Research University Higher School of EconomicsAlgorithmic ToolboxAlgorithmic ToolboxView courseStanford UniversityDivide and Conquer, Sorting and Searching, and Randomized AlgorithmsDivide and Conquer, Sorting and Searching, and Randomized AlgorithmsView courseRice UniversityAlgorithmic Thinking (Part 1)Algorithmic Thinking (Part 1)View course
Coursera provides universal access to the world’s best education,
partnering with top universities and organizations to offer courses online.(C) 2018 Coursera Inc. All rights reserved. - 沪ICP备号在现实生活中,记录日志非常重要。银行转账时会有转账记录;飞机飞行过程中,会有黑盒子(飞行数据记录器)记录飞行过程中的一切。如果有出现什么问题,人们可以通过日志数据来搞清楚到底发生了什么。对于系统开发、调试以及运行,记录日志都是同样的重要。如果没有日志记录,程序崩溃时你几乎就没办法弄明白到底发生了什么事情。举个例子,当你在写一个服务器程序时,记录日志是非常有必要的。下面展示的就是 EZComet.com 服务器的日志文件截图。服务崩溃后,如果没有日志,我几乎没办法知道到底发生了错误。日志不仅对于服务器很重要,对于桌面图形应用同样十分重要。比如,当你的客户的 PC 机程序崩溃时,你可以让他们把日志文件发给你,这样你就可以找到问题到底出在哪儿。相信我,在不同的 PC 环境下,你永远不会知道会有怎样奇怪的问题。我曾经就接收到过这样的错误日志。我最终发现,这个客户的 PC 机被一种病毒感染,导致了调用 gethostname 函数失败。看吧,如果没有日志可以查你怎么可能知道这些。打印输出不是个好办法尽管记录日志非常重要,但是并不是所有的开发者都能正确地使用它。我曾看到一些开发者是这样记录日志的,在开发的过程中插入 print 语句,开发结束后再将这些语句移除。就像这样:这种方式对于简单脚本型程序有用,但是如果是复杂的系统,你最好不要使用这样的方式。首先,你没办法做到在日志文件中只留下极其重要的消息。你会看到大量的消息日志。但是你却找不到任何有用的信息。你除了移除这输出语句这外,没别的办法控制代码,但是极有可能的是你忘记了移出那些没用的输出。再者,print 输出的所有信息都到了标准输出中,这将严重影响到你从标准输出中查看其它输出数据。当然,你也可以把消息输出到 stderr ,但是用 print 做日志记录的方式还是不好。使用 python 的标准日志模块那么,怎么样记录日志才是正确的呢?其实非常简单,使用 python 的标准日志模块。多亏 python 社区将日志做成了一个标准模块。它非常简单易用且十分灵活。你可以像这样使用日志系统:运行的时候就可看到:你可能会问这与使用 print 有什么不同呢。它有以下的优势:有许多的重要性别级可供选择,debug、info、warning、error 以及 critical。通过赋予 logger 或者 handler 不同的级别,你就可以只输出错误消息到特定的记录文件中,或者在调试时只记录调试信息。让我们把 logger 的级别改成 DEBUG 再看一下输出结果:输出变成了:正如看到的那样,我们把 logger 的等级改为 DEBUG 后,调试记录就出现在了输出当中。你也可以选择怎么处理这些消息。例如,你可以使用 FileHandler 把记录写进文件中:以合适的等级输出日志记录有了灵活的日志记录模块后,你可以按适当的等级将日志记录输出到任何地方然后配置它们。那么你可能会问,什么是合适的等级呢?在这儿我将分享一些我的经验。大多数的情况下,你都不想阅读日志中的太多细节。因此,只有你在调试过程中才会使用 DEBUG 等级。我只使用 DEBUG 获取详细的调试信息,特别是当数据量很大或者频率很高的时候,比如算法内部每个循环的中间状态。在处理请求或者服务器状态变化等日常事务中,我会使用 INFO 等级。当发生很重要的事件,但是并不是错误时,我会使用 WARNING 。比如,当用户登录密码错误时,或者连接变慢时。有错误发生时肯定会使用 ERROR 等级了。比如抛出异常,IO 操作失败或者连接问题等。我很少使用 CRITICAL 。当一些特别糟糕的事情发生时,你可以使用这个级别来记录。比方说,内存耗尽,磁盘满了或者核危机(希望永远别发生 :S)。查看评分情况
全部评分此主贴暂时没有点赞评分总计:赞0次版主推荐上一篇:下一篇:精品在线课程【一线专家讲授+24小时内答疑+永久免费观看+市场1/10价格】共有1条评论谢谢楼主,好久没看到这么好的贴了发表 本论坛发帖,请先课课家运营团队Mr kenYUIcappuccinomr jackIT宅男Mright课课家软考1最后发贴:
20:26最后发贴:
11:43最后发贴:
22:23最后发贴:
22:18最后发贴:
13:00课程推荐楼主关注热门贴子123456789123456789发布新贴选择版块:论坛站务软件考试华为认证计算机等级Photoshop3DMAX编程语言移动开发系统运维产品运营淘宝营销办公软件Ps修图云计算大数据摄影就业标题:内容验证码:编辑帖子标题:内容&p style=&border: 0 margin-top: 0 margin-bottom: 20 padding: 0 font-size: 15 color: rgb(46, 46, 46); font-family: &Microsoft YaHei&, 宋体, &Myriad Pro&, Lato, &Helvetica Neue&, Helvetica, Arial, sans- white-space: background-color: rgb(255, 255, 255);&&在现实生活中,记录日志非常重要。银行转账时会有转账记录;飞机飞行过程中,会有黑盒子(飞行数据记录器)记录飞行过程中的一切。如果有出现什么问题,人们可以通过日志数据来搞清楚到底发生了什么。&/p&&p style=&border: 0 margin-top: 0 margin-bottom: 20 padding: 0 font-size: 15 color: rgb(46, 46, 46); font-family: &Microsoft YaHei&, 宋体, &Myriad Pro&, Lato, &Helvetica Neue&, Helvetica, Arial, sans- white-space: background-color: rgb(255, 255, 255);&&对于系统开发、调试以及运行,记录日志都是同样的重要。如果没有日志记录,程序崩溃时你几乎就没办法弄明白到底发生了什么事情。举个例子,当你在写一个服务器程序时,记录日志是非常有必要的。下面展示的就是 EZComet.com 服务器的日志文件截图。&/p&&p&&img src=&/Public/forum/ueditor/image/1.png& title=&6681.png& alt=&image.png&/&&/p&&p&&span style=&color: rgb(46, 46, 46); font-family: &Microsoft YaHei&, 宋体, &Myriad Pro&, Lato, &Helvetica Neue&, Helvetica, Arial, sans- font-size: 15 background-color: rgb(255, 255, 255);&&服务崩溃后,如果没有日志,我几乎没办法知道到底发生了错误。日志不仅对于服务器很重要,对于桌面图形应用同样十分重要。比如,当你的客户的 PC 机程序崩溃时,你可以让他们把日志文件发给你,这样你就可以找到问题到底出在哪儿。相信我,在不同的 PC 环境下,你永远不会知道会有怎样奇怪的问题。我曾经就接收到过这样的错误日志。&/span&&/p&&p&&span style=&color: rgb(46, 46, 46); font-family: &Microsoft YaHei&, 宋体, &Myriad Pro&, Lato, &Helvetica Neue&, Helvetica, Arial, sans- font-size: 15 background-color: rgb(255, 255, 255);&&&img src=&/Public/forum/ueditor/image/3.png& title=&2613.png& alt=&image.png&/&&/span&&/p&&p&&/p&&p style=&border: 0 margin-top: 0 margin-bottom: 20 padding: 0 font-size: 15 color: rgb(46, 46, 46); font-family: &Microsoft YaHei&, 宋体, &Myriad Pro&, Lato, &Helvetica Neue&, Helvetica, Arial, sans- white-space: background-color: rgb(255, 255, 255);&&我最终发现,这个客户的 PC 机被一种病毒感染,导致了调用 gethostname 函数失败。看吧,如果没有日志可以查你怎么可能知道这些。&/p&&h3 style=&border: 0 margin: 0px 0px 20 padding: 0 font-size: 20 font-variant-numeric: font-variant-east-asian: font-stretch: line-height: 30 font-family: &Microsoft YaHei&, &Myriad Pro&, Lato, &Helvetica Neue&, Helvetica, Arial, sans- color: rgb(46, 46, 46); white-space: background-color: rgb(255, 255, 255);&&打印输出不是个好办法&/h3&&p style=&border: 0 margin-top: 0 margin-bottom: 20 padding: 0 font-size: 15 color: rgb(46, 46, 46); font-family: &Microsoft YaHei&, 宋体, &Myriad Pro&, Lato, &Helvetica Neue&, Helvetica, Arial, sans- white-space: background-color: rgb(255, 255, 255);&&尽管记录日志非常重要,但是并不是所有的开发者都能正确地使用它。我曾看到一些开发者是这样记录日志的,在开发的过程中插入 print 语句,开发结束后再将这些语句移除。就像这样:&/p&&p&&img src=&/Public/forum/ueditor/image/6.png& title=&8036.png& alt=&image.png&/&&/p&&p&&/p&&p style=&border: 0 margin-top: 0 margin-bottom: 20 padding: 0 font-size: 15 color: rgb(46, 46, 46); font-family: &Microsoft YaHei&, 宋体, &Myriad Pro&, Lato, &Helvetica Neue&, Helvetica, Arial, sans- white-space: background-color: rgb(255, 255, 255);&&这种方式对于简单脚本型程序有用,但是如果是复杂的系统,你最好不要使用这样的方式。首先,你没办法做到在日志文件中只留下极其重要的消息。你会看到大量的消息日志。但是你却找不到任何有用的信息。你除了移除这输出语句这外,没别的办法控制代码,但是极有可能的是你忘记了移出那些没用的输出。再者,print 输出的所有信息都到了标准输出中,这将严重影响到你从标准输出中查看其它输出数据。当然,你也可以把消息输出到 stderr ,但是用 print 做日志记录的方式还是不好。&/p&&h3 style=&border: 0 margin: 0px 0px 20 padding: 0 font-size: 20 font-variant-numeric: font-variant-east-asian: font-stretch: line-height: 30 font-family: &Microsoft YaHei&, &Myriad Pro&, Lato, &Helvetica Neue&, Helvetica, Arial, sans- color: rgb(46, 46, 46); white-space: background-color: rgb(255, 255, 255);&&使用 python 的标准日志模块&/h3&&p style=&border: 0 margin-top: 0 margin-bottom: 20 padding: 0 font-size: 15 color: rgb(46, 46, 46); font-family: &Microsoft YaHei&, 宋体, &Myriad Pro&, Lato, &Helvetica Neue&, Helvetica, Arial, sans- white-space: background-color: rgb(255, 255, 255);&&那么,怎么样记录日志才是正确的呢?其实非常简单,使用 python 的标准日志模块。多亏 python 社区将日志做成了一个标准模块。它非常简单易用且十分灵活。你可以像这样使用日志系统:&/p&&p&&img src=&/Public/forum/ueditor/image/1.png& title=&1681.png& alt=&image.png&/&&/p&&p style=&border: 0 margin-top: 0 margin-bottom: 20 padding: 0 font-size: 15 color: rgb(46, 46, 46); font-family: &Microsoft YaHei&, 宋体, &Myriad Pro&, Lato, &Helvetica Neue&, Helvetica, Arial, sans- white-space: background-color: rgb(255, 255, 255);&&运行的时候就可看到:&/p&&p style=&border: 0 margin-top: 0 margin-bottom: 20 padding: 0 font-size: 15 color: rgb(46, 46, 46); font-family: &Microsoft YaHei&, 宋体, &Myriad Pro&, Lato, &Helvetica Neue&, Helvetica, Arial, sans- white-space: background-color: rgb(255, 255, 255);&&&img src=&/Public/forum/ueditor/image/4.png& title=&0224.png& alt=&image.png&/&&/p&&p style=&border: 0 margin-top: 0 margin-bottom: 20 padding: 0 font-size: 15 color: rgb(46, 46, 46); font-family: &Microsoft YaHei&, 宋体, &Myriad Pro&, Lato, &Helvetica Neue&, Helvetica, Arial, sans- white-space: background-color: rgb(255, 255, 255);&&你可能会问这与使用 print 有什么不同呢。它有以下的优势:&/p&&ul style=&border: 0 margin-bottom: 20 padding: 0 font-size: 15 list-style-position: list-style-image: color: rgb(46, 46, 46); font-family: &Microsoft YaHei&, 宋体, &Myriad Pro&, Lato, &Helvetica Neue&, Helvetica, Arial, sans- white-space: background-color: rgb(255, 255, 255);& class=& list-paddingleft-2&&&li&&p&你可以控制消息的级别,过滤掉那些并不重要的消息。&/p&&/li&&li&&p&你可决定输出到什么地方,以及怎么输出。&/p&&/li&&/ul&&p style=&border: 0 margin-top: 0 margin-bottom: 20 padding: 0 font-size: 15 color: rgb(46, 46, 46); font-family: &Microsoft YaHei&, 宋体, &Myriad Pro&, Lato, &Helvetica Neue&, Helvetica, Arial, sans- white-space: background-color: rgb(255, 255, 255);&&有许多的重要性别级可供选择,debug、info、warning、error 以及 critical。通过赋予 logger 或者 handler 不同的级别,你就可以只输出错误消息到特定的记录文件中,或者在调试时只记录调试信息。让我们把 logger 的级别改成 DEBUG 再看一下输出结果:&/p&&p style=&border: 0 margin-top: 0 margin-bottom: 20 padding: 0 font-size: 15 color: rgb(46, 46, 46); font-family: &Microsoft YaHei&, 宋体, &Myriad Pro&, Lato, &Helvetica Neue&, Helvetica, Arial, sans- white-space: background-color: rgb(255, 255, 255);&&&img src=&/Public/forum/ueditor/image/2.png& title=&4582.png& alt=&image.png&/&&/p&&p style=&border: 0 margin-top: 0 margin-bottom: 20 padding: 0 font-size: 15 color: rgb(46, 46, 46); font-family: &Microsoft YaHei&, 宋体, &Myriad Pro&, Lato, &Helvetica Neue&, Helvetica, Arial, sans- white-space: background-color: rgb(255, 255, 255);&&&span style=&color: rgb(46, 46, 46); font-family: &Microsoft YaHei&, 宋体, &Myriad Pro&, Lato, &Helvetica Neue&, Helvetica, Arial, sans- font-size: 15 background-color: rgb(255, 255, 255);&&输出变成了:&/span&&/p&&p style=&border: 0 margin-top: 0 margin-bottom: 20 padding: 0 font-size: 15 color: rgb(46, 46, 46); font-family: &Microsoft YaHei&, 宋体, &Myriad Pro&, Lato, &Helvetica Neue&, Helvetica, Arial, sans- white-space: background-color: rgb(255, 255, 255);&&&span style=&color: rgb(46, 46, 46); font-family: &Microsoft YaHei&, 宋体, &Myriad Pro&, Lato, &Helvetica Neue&, Helvetica, Arial, sans- font-size: 15 background-color: rgb(255, 255, 255);&&&img src=&/Public/forum/ueditor/image/7.png& title=&7687.png& alt=&image.png&/&&/span&&/p&&p style=&border: 0 margin-top: 0 margin-bottom: 20 padding: 0 font-size: 15 color: rgb(46, 46, 46); font-family: &Microsoft YaHei&, 宋体, &Myriad Pro&, Lato, &Helvetica Neue&, Helvetica, Arial, sans- white-space: background-color: rgb(255, 255, 255);&&&span style=&color: rgb(46, 46, 46); font-family: &Microsoft YaHei&, 宋体, &Myriad Pro&, Lato, &Helvetica Neue&, Helvetica, Arial, sans- font-size: 15 background-color: rgb(255, 255, 255);&&&span style=&color: rgb(46, 46, 46); font-family: &Microsoft YaHei&, 宋体, &Myriad Pro&, Lato, &Helvetica Neue&, Helvetica, Arial, sans- font-size: 15 background-color: rgb(255, 255, 255);&&正如看到的那样,我们把 logger 的等级改为 DEBUG 后,调试记录就出现在了输出当中。你也可以选择怎么处理这些消息。例如,你可以使用 FileHandler 把记录写进文件中:&/span&&/span&&/p&&p style=&border: 0 margin-top: 0 margin-bottom: 20 padding: 0 font-size: 15 color: rgb(46, 46, 46); font-family: &Microsoft YaHei&, 宋体, &Myriad Pro&, Lato, &Helvetica Neue&, Helvetica, Arial, sans- white-space: background-color: rgb(255, 255, 255);&&&span style=&color: rgb(46, 46, 46); font-family: &Microsoft YaHei&, 宋体, &Myriad Pro&, Lato, &Helvetica Neue&, Helvetica, Arial, sans- font-size: 15 background-color: rgb(255, 255, 255);&&&span style=&color: rgb(46, 46, 46); font-family: &Microsoft YaHei&, 宋体, &Myriad Pro&, Lato, &Helvetica Neue&, Helvetica, Arial, sans- font-size: 15 background-color: rgb(255, 255, 255);&&&img src=&/Public/forum/ueditor/image/6.png& title=&8946.png& alt=&image.png&/&&/span&&/span&&/p&&p style=&border: 0 margin-top: 0 margin-bottom: 20 padding: 0 font-size: 15 color: rgb(46, 46, 46); font-family: &Microsoft YaHei&, 宋体, &Myriad Pro&, Lato, &Helvetica Neue&, Helvetica, Arial, sans- white-space: background-color: rgb(255, 255, 255);&&&/p&&h3 style=&border: 0 margin: 0px 0px 20 padding: 0 font-size: 20 font-variant-numeric: font-variant-east-asian: font-stretch: line-height: 30 font-family: &Microsoft YaHei&, &Myriad Pro&, Lato, &Helvetica Neue&, Helvetica, Arial, sans- color: rgb(46, 46, 46); white-space: background-color: rgb(255, 255, 255);&&以合适的等级输出日志记录&/h3&&p style=&border: 0 margin-top: 0 margin-bottom: 20 padding: 0 font-size: 15 color: rgb(46, 46, 46); font-family: &Microsoft YaHei&, 宋体, &Myriad Pro&, Lato, &Helvetica Neue&, Helvetica, Arial, sans- white-space: background-color: rgb(255, 255, 255);&&有了灵活的日志记录模块后,你可以按适当的等级将日志记录输出到任何地方然后配置它们。那么你可能会问,什么是合适的等级呢?在这儿我将分享一些我的经验。&/p&&p style=&border: 0 margin-top: 0 margin-bottom: 20 padding: 0 font-size: 15 color: rgb(46, 46, 46); font-family: &Microsoft YaHei&, 宋体, &Myriad Pro&, Lato, &Helvetica Neue&, Helvetica, Arial, sans- white-space: background-color: rgb(255, 255, 255);&&大多数的情况下,你都不想阅读日志中的太多细节。因此,只有你在调试过程中才会使用 DEBUG 等级。我只使用 DEBUG 获取详细的调试信息,特别是当数据量很大或者频率很高的时候,比如算法内部每个循环的中间状态。&/p&&p style=&border: 0 margin-top: 0 margin-bottom: 20 padding: 0 font-size: 15 color: rgb(46, 46, 46); font-family: &Microsoft YaHei&, 宋体, &Myriad Pro&, Lato, &Helvetica Neue&, Helvetica, Arial, sans- white-space: background-color: rgb(255, 255, 255);&&&img src=&/Public/forum/ueditor/image/8.png& title=&3348.png& alt=&image.png&/&&/p&&p style=&border: 0 margin-top: 0 margin-bottom: 20 padding: 0 font-size: 15 color: rgb(46, 46, 46); font-family: &Microsoft YaHei&, 宋体, &Myriad Pro&, Lato, &Helvetica Neue&, Helvetica, Arial, sans- white-space: background-color: rgb(255, 255, 255);&&&span style=&color: rgb(46, 46, 46); font-family: &Microsoft YaHei&, 宋体, &Myriad Pro&, Lato, &Helvetica Neue&, Helvetica, Arial, sans- font-size: 15 background-color: rgb(255, 255, 255);&&在处理请求或者服务器状态变化等日常事务中,我会使用 INFO 等级。&/span&&/p&&p style=&border: 0 margin-top: 0 margin-bottom: 20 padding: 0 font-size: 15 color: rgb(46, 46, 46); font-family: &Microsoft YaHei&, 宋体, &Myriad Pro&, Lato, &Helvetica Neue&, Helvetica, Arial, sans- white-space: background-color: rgb(255, 255, 255);&&&span style=&color: rgb(46, 46, 46); font-family: &Microsoft YaHei&, 宋体, &Myriad Pro&, Lato, &Helvetica Neue&, Helvetica, Arial, sans- font-size: 15 background-color: rgb(255, 255, 255);&&&img src=&/Public/forum/ueditor/image/3.png& title=&9173.png& alt=&image.png&/&&/span&&/p&&p style=&border: 0 margin-top: 0 margin-bottom: 20 padding: 0 font-size: 15 color: rgb(46, 46, 46); font-family: &Microsoft YaHei&, 宋体, &Myriad Pro&, Lato, &Helvetica Neue&, Helvetica, Arial, sans- white-space: background-color: rgb(255, 255, 255);&&&span style=&color: rgb(46, 46, 46); font-family: &Microsoft YaHei&, 宋体, &Myriad Pro&, Lato, &Helvetica Neue&, Helvetica, Arial, sans- font-size: 15 background-color: rgb(255, 255, 255);&&&span style=&color: rgb(46, 46, 46); font-family: &Microsoft YaHei&, 宋体, &Myriad Pro&, Lato, &Helvetica Neue&, Helvetica, Arial, sans- font-size: 15 background-color: rgb(255, 255, 255);&&当发生很重要的事件,但是并不是错误时,我会使用 WARNING 。比如,当用户登录密码错误时,或者连接变慢时。&/span&&/span&&/p&&p style=&border: 0 margin-top: 0 margin-bottom: 20 padding: 0 font-size: 15 color: rgb(46, 46, 46); font-family: &Microsoft YaHei&, 宋体, &Myriad Pro&, Lato, &Helvetica Neue&, Helvetica, Arial, sans- white-space: background-color: rgb(255, 255, 255);&&&img src=&/Public/forum/ueditor/image/9.png& title=&4029.png& alt=&image.png&/&&/p&&p style=&border: 0 margin-top: 0 margin-bottom: 20 padding: 0 font-size: 15 color: rgb(46, 46, 46); font-family: &Microsoft YaHei&, 宋体, &Myriad Pro&, Lato, &Helvetica Neue&, Helvetica, Arial, sans- white-space: background-color: rgb(255, 255, 255);&&有错误发生时肯定会使用 ERROR 等级了。比如抛出异常,IO 操作失败或者连接问题等。&/p&&p style=&border: 0 margin-top: 0 margin-bottom: 20 padding: 0 font-size: 15 color: rgb(46, 46, 46); font-family: &Microsoft YaHei&, 宋体, &Myriad Pro&, Lato, &Helvetica Neue&, Helvetica, Arial, sans- white-space: background-color: rgb(255, 255, 255);&&&img src=&/Public/forum/ueditor/image/7.png& title=&9517.png& alt=&image.png&/&&/p&&p style=&border: 0 margin-top: 0 margin-bottom: 20 padding: 0 font-size: 15 color: rgb(46, 46, 46); font-family: &Microsoft YaHei&, 宋体, &Myriad Pro&, Lato, &Helvetica Neue&, Helvetica, Arial, sans- white-space: background-color: rgb(255, 255, 255);&&&span style=&color: rgb(46, 46, 46); font-family: &Microsoft YaHei&, 宋体, &Myriad Pro&, Lato, &Helvetica Neue&, Helvetica, Arial, sans- font-size: 15 background-color: rgb(255, 255, 255);&&我很少使用 CRITICAL 。当一些特别糟糕的事情发生时,你可以使用这个级别来记录。比方说,内存耗尽,磁盘满了或者核危机(希望永远别发生 :S)。&/span&&/p&选择版块:论坛站务软件考试华为认证计算机等级Photoshop3DMAX编程语言移动开发系统运维产品运营淘宝营销办公软件Ps修图云计算大数据摄影就业移动帖子移动到:

我要回帖

更多关于 哪种编程语言应用广泛 的文章

 

随机推荐