Browse Source

Add debug-log documentation and enable it by default

djm34
Jan Berdajs 11 years ago
parent
commit
2d66c44b42
  1. 7
      README.md
  2. 17
      doc/configuration.md
  3. 3
      sgminer.c

7
README.md

@ -419,10 +419,9 @@ file and any changes that may have been made.
sgminer will log to stderr if it detects stderr is being redirected to a sgminer will log to stderr if it detects stderr is being redirected to a
file. To enable logging simply append `2>logfile.txt` to your command line file. To enable logging simply append `2>logfile.txt` to your command line
and `logfile.txt` will contain the logged output at the log level you and `logfile.txt` will contain all debug output unless you set `debug-log`
specify (normal, verbose, debug etc.). If you use the `--debug-log` option to `false`, in which case it will only contain output at the log level you
then everything will be logged to the file (console output will remain as specified (notice by default).
configured).
There is also the -m option on Linux which will spawn a command of your choice There is also the -m option on Linux which will spawn a command of your choice
and pipe the output directly to that command. and pipe the output directly to that command.

17
doc/configuration.md

@ -456,6 +456,7 @@ sgminer 4.2.1-116-g2e8b-dirty
* [Miscellaneous Options](#miscellaneous-options) * [Miscellaneous Options](#miscellaneous-options)
* [compact](#compact) * [compact](#compact)
* [debug](#debug) * [debug](#debug)
* [debug-log](#debug-log)
* [default-profile](#default-profile) * [default-profile](#default-profile)
* [device](#device) * [device](#device)
* [difficulty-multiplier](#difficulty-multiplier) * [difficulty-multiplier](#difficulty-multiplier)
@ -1793,6 +1794,22 @@ Enable debug output.
[Top](#configuration-and-command-line-options) :: [Config-file and CLI options](#config-file-and-cli-options) :: [Miscellaneous Options](#miscellaneous-options) [Top](#configuration-and-command-line-options) :: [Config-file and CLI options](#config-file-and-cli-options) :: [Miscellaneous Options](#miscellaneous-options)
### debug-log
Enable debug logging when stderr is redirected to file.
*Available*: Global
*Config File Syntax:* `"debug-log":false`
*Command Line Syntax:* `--debug-log`
*Argument:* None
*Default:* `true`
[Top](#configuration-and-command-line-options) :: [Config-file and CLI options](#config-file-and-cli-options) :: [Miscellaneous Options](#miscellaneous-options)
### default-profile ### default-profile
Use this profile for sgminer's default settings. Use this profile for sgminer's default settings.

3
sgminer.c

@ -8202,6 +8202,9 @@ int main(int argc, char *argv[])
sigaction(SIGINT, &handler, &inthandler); sigaction(SIGINT, &handler, &inthandler);
#endif #endif
/* enable debug output to file by default is stderr is redirected to a file */
opt_debug = !isatty(fileno((FILE *)stderr));
/* opt_kernel_path defaults to SGMINER_PREFIX */ /* opt_kernel_path defaults to SGMINER_PREFIX */
opt_kernel_path = (char *)alloca(PATH_MAX); opt_kernel_path = (char *)alloca(PATH_MAX);
strcpy(opt_kernel_path, SGMINER_PREFIX); strcpy(opt_kernel_path, SGMINER_PREFIX);

Loading…
Cancel
Save