From 6eee6c181d7d4762e08873750efd80a16e86b6ef Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Thu, 26 Mar 2015 11:27:06 +0800 Subject: [PATCH] Improves #1295 --- atom/app/atom_main_delegate.cc | 6 ++---- docs/api/chrome-command-line-switches.md | 26 +++++++++++------------- 2 files changed, 14 insertions(+), 18 deletions(-) diff --git a/atom/app/atom_main_delegate.cc b/atom/app/atom_main_delegate.cc index 5e383088638d..1ca9a619e100 100644 --- a/atom/app/atom_main_delegate.cc +++ b/atom/app/atom_main_delegate.cc @@ -36,17 +36,15 @@ bool AtomMainDelegate::BasicStartupComplete(int* exit_code) { settings.delete_old = logging::DELETE_OLD_LOG_FILE; #else settings.logging_dest = logging::LOG_TO_SYSTEM_DEBUG_LOG; -#endif +#endif // defined(DEBUG) #endif // defined(OS_WIN) - - // allows setting loglevel --v or --vmodule logging::InitLogging(settings); // Logging with pid and timestamp. logging::SetLogItems(true, false, true, false); - // Enable convient stack printing. #if defined(DEBUG) && defined(OS_LINUX) + // Enable convient stack printing. base::debug::EnableInProcessStackDumping(); #endif diff --git a/docs/api/chrome-command-line-switches.md b/docs/api/chrome-command-line-switches.md index e5ff685a6908..e2386cc7af32 100644 --- a/docs/api/chrome-command-line-switches.md +++ b/docs/api/chrome-command-line-switches.md @@ -64,27 +64,25 @@ Ignore certificate related errors. ## --v=`log_level` -Gives the default maximal active V-logging level; 0 is the default. -Normally positive values are used for V-logging levels. +Gives the default maximal active V-logging level; 0 is the default. Normally +positive values are used for V-logging levels. --1 to disable logs +Passing `--v=-1` will disable logging. ## --vmodule=`pattern` -Gives the per-module maximal V-logging levels to override the value -given by --v. E.g. "my_module=2,foo*=3" would change the logging -level for all code in source files "my_module.*" and "foo*.*" -("-inl" suffixes are also disregarded for this matching). +Gives the per-module maximal V-logging levels to override the value given by +`--v`. E.g. `my_module=2,foo*=3` would change the logging level for all code in +source files `my_module.*` and `foo*.*`. -Any pattern containing a forward or backward slash will be tested -against the whole pathname and not just the module. E.g., -"*/foo/bar/*=2" would change the logging level for all code in -source files under a "foo/bar" directory. +Any pattern containing a forward or backward slash will be tested against the +whole pathname and not just the module. E.g. `*/foo/bar/*=2` would change the +logging level for all code in source files under a `foo/bar` directory. -For example to disable all chromium related logs and only enable -your application logs +To disable all chromium related logs and only enable your application logs you +can do: -``` +```javascript app.commandLine.appendSwitch('v', -1); app.commandLine.appendSwitch('vmodule', 'console=0'); ```