verbosity

How to determine what log level to use? [closed]

假装没事ソ 提交于 2019-12-02 15:42:37
The log levels WARN, ERROR and FATAL are pretty clear. But when is something DEBUG, and when INFO? I've seen some projects that are annoyingly verbose on the INFO level, but I've also seen code that favors the DEBUG level too much. In both cases, useful information is hidden in the noise. What are the criteria for determining log levels? I don't think there are any hard-and-fast rules; using the log4j-type levels, my 'rules of thumb' are something like: FATAL : the app (or at the very least a thread) is about to die horribly. This is where the info explaining why that's happening goes. ERROR :

Ruby-like Question: Make this function shorter (ActionScript 3)

孤街浪徒 提交于 2019-12-01 06:49:07
I just wrote this incredibly verbose code to turn numbers like 2 into 02. Can you make this function shorter, please (maintaning the functionality)? public static function format(n:int, minimumLength:int):String { var retVal:String = n.toString(); var stillNeed:int = minimumLength - retVal.length; for (var i:int = 0; i < stillNeed; i++) { retVal = "0" + retVal; } return retVal; } Please use types for variables. Extra points (good-vibe points, not SO points) if there's already a built-in function that I don't know about. If anybody wants to post some extremely short equivalent in some other

disable NOTICES in psql output

谁说胖子不能爱 提交于 2019-11-30 10:39:29
问题 How do I stop psql (PostgreSQL client) from outputting notices? e.g. psql:schema/auth.sql:20: NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "users_pkey" for table "users" In my opinion a program should be silent unless it has an error, or some other reason to output stuff. 回答1: SET client_min_messages TO WARNING; That could be set only for the session or made persistent with ALTER ROLE or ALTER DATABASE. Or you could put that in your ".psqlrc". 回答2: Probably the most

How do I suppress the bloat of useless information when using the DUMP command while using grunt via 'pig -x local'?

徘徊边缘 提交于 2019-11-30 09:07:05
I'm working with PigLatin, using grunt, and every time I 'dump' stuffs, my console gets clobbered with blah blah, blah non-info, is there a way to surpress all that? grunt> A = LOAD 'testingData' USING PigStorage(':'); dump A; 2013-05-06 19:42:04,146 [main] INFO org.apache.pig.tools.pigstats.ScriptState - Pig features used in the script: UNKNOWN 2013-05-06 19:42:04,147 [main] INFO org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.MRCompiler - File concatenation threshold: 100 optimistic? false ... ... --- another like 50 lines of useless context clobbering junk here... till --- ...

Usage patterns for private, static, final, public, abstract keywords in java

家住魔仙堡 提交于 2019-11-30 06:29:20
问题 I know what all of these do except for abstract. I'm currently in the process of teaching myself java with what I consider a middle-school-level education (my highschool was in a bad neighborhood so I got shafted)... But what exactly are the usage patterns for these keywords? When do I use what? When do I omit them? Putting 'public' in front of my classes makes every class that uses it require a new file, can I just omit that if I want to create a monolithic source file? Every bit of

How to change verbosity of the MSBuild task?

筅森魡賤 提交于 2019-11-30 02:17:36
问题 I'd like to have a different verbosity for the msbuild project invoked from the commandline, and those invoked by the MSBuild task from within the project. For example: Inside my.proj: <Target Name=Foo> <MSBuild Projects="a.csproj;b.csproj;c.csproj"/> </Target> On the commandline: msbuild /v:d my.proj now when the MSBuild task builds the .csproj files, it does it with detailed verbosity as well. However I'd want to build it with minimal verbosity. I know it is possible to invoke msbuild

disable NOTICES in psql output

大憨熊 提交于 2019-11-29 21:14:18
How do I stop psql (PostgreSQL client) from outputting notices? e.g. psql:schema/auth.sql:20: NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "users_pkey" for table "users" In my opinion a program should be silent unless it has an error, or some other reason to output stuff. SET client_min_messages TO WARNING; That could be set only for the session or made persistent with ALTER ROLE or ALTER DATABASE . Or you could put that in your ".psqlrc" . Probably the most comprehensive explanation is on Peter Eisentrauts blog entry here I would strongly encourage that the original blog be

How do I suppress the bloat of useless information when using the DUMP command while using grunt via 'pig -x local'?

孤人 提交于 2019-11-29 13:54:49
问题 I'm working with PigLatin, using grunt, and every time I 'dump' stuffs, my console gets clobbered with blah blah, blah non-info, is there a way to surpress all that? grunt> A = LOAD 'testingData' USING PigStorage(':'); dump A; 2013-05-06 19:42:04,146 [main] INFO org.apache.pig.tools.pigstats.ScriptState - Pig features used in the script: UNKNOWN 2013-05-06 19:42:04,147 [main] INFO org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.MRCompiler - File concatenation threshold: 100

Suppress console output in PowerShell

风流意气都作罢 提交于 2019-11-28 22:21:34
I have a call to GPG in the following way in a PowerShell script: $key = & 'gpg' --decrypt "secret.gpg" --quiet --no-verbose > $null I don't want any output from GPG to be seen on the main console when I'm running the script. Due to my noobness in PowerShell, I don't know how to do this. I searched Stack Overflow and googled for a way to do it, found a lot of ways to do it, but non of it worked. The "> $null" for example has no effect. I found the --quiet --no-verbose options for GPG to put less output in the console, still it's not completely quiet, and I'm sure there is a way in PowerShell

Usage patterns for private, static, final, public, abstract keywords in java

会有一股神秘感。 提交于 2019-11-28 18:58:59
I know what all of these do except for abstract. I'm currently in the process of teaching myself java with what I consider a middle-school-level education (my highschool was in a bad neighborhood so I got shafted)... But what exactly are the usage patterns for these keywords? When do I use what? When do I omit them? Putting 'public' in front of my classes makes every class that uses it require a new file, can I just omit that if I want to create a monolithic source file? Every bit of information I look up, explains exactly WHAT these do, just doesn't give a clear view of when/why/where I