SINGA-117 add a switch for enabling/disabling INFO-level logging #109
SINGA-117 add a switch for enabling/disabling INFO-level logging #109cac2003 wants to merge 1 commit intoapache:masterfrom cac2003:logging
Conversation
There was a problem hiding this comment.
maybe a shorter name would be better as it is used frequently (easier for typing), e.g., DEBUG, kDebug, verbose_singa.. verbose is typically used as foo(arg1, arg2, verbose).
may put the declaration in singa.h, default value is false. the main function can parse a command line argument for this variable, e.g., -verbose true/false.
There was a problem hiding this comment.
Will replace it with verbose_singa.
If its declaration is put in singa.h, then every src file where this var appears should include singa.h as well as the files included in singa.h. Is it a bit redundant?
Since this is a global variable and defined as external, its real declaration and initialization should be put somewhere else. Which file do you think is appropriate for it?
btw, where is the main entrance(function) for singa located, singa/main.cc or utils/tool.cc?
There was a problem hiding this comment.
singa_verbose, Verbose, verbose_singa, which one is better?
singa.h is not included/used internally. it is to be included by user code.
hence other files inside src/ do not need to include singa.h to get this
external variable, right?
the main entrance is src/main.cc
On Wed, Dec 23, 2015 at 11:02 AM, CAI QINGCHAO notifications@github.com
wrote:
In include/singa/log.h
#109 (comment):+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*
+*************************************************************/
+
+#ifndef SINGA_LOG_H_
+#define SINGA_LOG_H_
+
+namespace singa {
- extern bool enable_info_log;
Will replace it with verbose_singa.
If its declaration is put in singa.h, then every src file where this var
appears should include singa.h as well as the files included in singa.h. Is
it a bit redundant?Since this is a global variable and defined as external, its real
declaration and initialization should be put somewhere else. Which file do
you think is appropriate for it?btw, where is the main entrance(function) for singa located, singa/main.cc
or utils/tool.cc?—
Reply to this email directly or view it on GitHub
https://github.com/apache/incubator-singa/pull/109/files#r48319012.
There was a problem hiding this comment.
- singa_verbose?
- I am afraid not. If this external var is defined in singa.h, then other files where this var appears needs either to include singa.h, or to have this external variable defined in its header. (The latter seems more feasible)
- So we can place the real definition and initialization in src/main.cc, as long as it is compiled into singa executable.
|
can we do it in this way? in singa.h in main.cc |
|
@cac2003 I am going to merge this pull request. before that, pls clean the commit msgs following the format http://singa.apache.org/develop/contribute-code.html.
|
|
how to determine the xxx part of commit msg title? |
|
Once you create the jira ticket you will see a ticket No., which is the xxx Sent from my iPhone
|
Add a switch for enabling/disabling INFO-level logging. This switch is off by default. One can enable it by passing -verbose option when launching singa.
|
Could you pls unify the format of all key-value tuples in the log? |
add switch for enabling/disabling INFO-level logging