Bug 578366 - Quiet mode to disable ANSI codes in log files
Summary: Quiet mode to disable ANSI codes in log files
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Publican
Classification: Community
Component: publican
Version: 1.6
Hardware: All
OS: Linux
low
low
Target Milestone: ---
Assignee: Jeff Fearn 🐞
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-03-31 03:14 UTC by Sean Flanigan
Modified: 2010-11-24 04:18 UTC (History)
5 users (show)

Fixed In Version: publican-1.6.3-0.fc12
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2010-05-17 18:56:22 UTC
Embargoed:


Attachments (Terms of Use)

Description Sean Flanigan 2010-03-31 03:14:12 UTC
Description of problem:
I'm running publican from a continuous build server (Hudson), and the output is a little cluttered, partly because Hudson treats logs as plain text.  The same thing happens if you redirect stderr to a file and view it in plain text mode.

Would it be possible to add a --quiet mode, or --color=never, or perhaps to auto-detect output streams which don't support ANSI codes?

Version-Release number of selected component (if applicable):
1.6.1

How reproducible:


Steps to Reproduce:
1. publican build > logfile 2>&1
2. /usr/bin/less logfile
  
Actual results:

[36m	PO file 'de-DE/known_issues.po' not found! Using base XML!
[0m[36m	PO file 'de-DE/migration.po' not found! Using base XML!
[0m[36m	PO file 'de-DE/new_features.po' not found! Using base XML!
[0m[36m	PO file 'de-DE/tech_previews.po' not found! Using base XML!
[0m[36m	PO file 'de-DE/upgrading.po' not found! Using base XML!
[0m	Processing file tmp/de-DE/xml/Common_Content/Conventions.xml

Expected results:

	PO file 'de-DE/known_issues.po' not found! Using base XML!
	PO file 'de-DE/migration.po' not found! Using base XML!
	PO file 'de-DE/new_features.po' not found! Using base XML!
	PO file 'de-DE/tech_previews.po' not found! Using base XML!
	PO file 'de-DE/upgrading.po' not found! Using base XML!
	Processing file tmp/de-DE/xml/Common_Content/Conventions.xml

Additional info:

It would also be nice the quiet mode could override the debug option in case it is specified in publican.cfg.

Comment 1 Ruediger Landmann 2010-04-01 03:11:46 UTC
--quiet and --nocolours options tested and working in 1.6.1-0.t29

Comment 2 Fedora Update System 2010-04-01 05:15:16 UTC
publican-1.6.2-0.fc12 has been submitted as an update for Fedora 12.
http://admin.fedoraproject.org/updates/publican-1.6.2-0.fc12

Comment 3 Fedora Update System 2010-04-01 05:15:41 UTC
publican-1.6.2-0.fc11 has been submitted as an update for Fedora 11.
http://admin.fedoraproject.org/updates/publican-1.6.2-0.fc11

Comment 4 Fedora Update System 2010-04-01 05:16:08 UTC
publican-1.6.2-0.fc13 has been submitted as an update for Fedora 13.
http://admin.fedoraproject.org/updates/publican-1.6.2-0.fc13

Comment 5 Sean Flanigan 2010-04-01 07:29:32 UTC
Thanks Jeff; it looks good, and I'm glad to see colour spelt better than I had dared hope!

Just a few minor things:

1. The descriptions of the new options don't line up with the other global options, at least on my terminal:
ie:
        -v                  Display the version of Publican
        --config <file>     Use a nonstandard config file
        --nocolours Disable ANSI colourisation of logging
        --quiet     Disable all logging

This is purely cosmetic, but it might bother some people.


2. Also, I found that these new options had to be entered after the action, eg

   publican build --quiet
not 
   publican --quiet build

The usage help (and the Publican documentation) seem to assume that global options never appear together with an action, but my experience with other command line tools does lead me to expect that global options will precede actions, eg:
   svn --non-interactive update


3. The Publican documentation hasn't been updated to describe these options, but I don't know if that's significant at this point.

Thanks for the quick turnaround!

Comment 6 Fedora Update System 2010-04-03 04:39:51 UTC
publican-1.6.2-0.fc12 has been pushed to the Fedora 12 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 7 Fedora Update System 2010-04-03 04:50:30 UTC
publican-1.6.2-0.fc11 has been pushed to the Fedora 11 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 8 Jeff Fearn 🐞 2010-04-06 02:00:50 UTC
This was confusing so I renamed and reordered the options and the help texts. Mainly because there are 3 kinds of options and only 2 were appearing in the helps texts >_<

Renamed 'Global Options' to 'Command Options' these apply only to the publican command, not to actions.

Renamed 'Options' to 'Action Options' these apply only to actions not to the publican command.

Displayed 'Common Options', common_config, nocolour etc, as part of the action help text.

$ bin/publican --help

Usage:
    publican <command options>

    publican <action> <action options>

    Command Options

        --help              Display help message
        --man               Display the man page
        --help_actions      Display a list of valid actions
        -v                  Display the version of Publican

    Run: 'publican <action> --help' for details on action usage

    Valid actions are:

        build         Transform XML to other formats (pdf, html, html-single, etc)
...


$ bin/publican build --help
build
    Transform XML to other formats (pdf, html, html-single, etc)

        Options:
        --help                    Display help message
        --config=s                Use a nonstandard config file
        --common_config=s         Override path to Common_Config directory
        --common_content=s        Override path to Common_Content directory
        --nocolours               Disable ANSI colourisation of logging.
        --quiet                   Disable all logging.
        --formats=<FORMATS>       Comma-separated list of formats, for example: html,pdf,html-single,html-desktop,txt,epub
        --langs=<LANGS>           Comma-separated list of languages, for example: en-US,de-DE,all
...


Will begin bugging Rudi to update docs :)

Comment 9 Fedora Update System 2010-04-09 04:27:57 UTC
publican-1.6.2-0.fc13 has been pushed to the Fedora 13 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 10 Jeff Fearn 🐞 2010-04-10 01:57:33 UTC
FYI I opened https://bugzilla.redhat.com/show_bug.cgi?id=581090 to address the naming issue in the next major version, since I think it's too disruptive for a minor version.

Comment 11 Fedora Update System 2010-05-13 22:20:05 UTC
publican-1.6.3-0.fc13 has been submitted as an update for Fedora 13.
http://admin.fedoraproject.org/updates/publican-1.6.3-0.fc13

Comment 12 Fedora Update System 2010-05-13 22:21:28 UTC
publican-1.6.3-0.fc12 has been submitted as an update for Fedora 12.
http://admin.fedoraproject.org/updates/publican-1.6.3-0.fc12

Comment 13 Fedora Update System 2010-05-15 20:35:41 UTC
publican-1.6.3-0.fc12 has been pushed to the Fedora 12 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update publican'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/publican-1.6.3-0.fc12

Comment 14 Fedora Update System 2010-05-15 20:45:04 UTC
publican-1.6.3-0.fc13 has been pushed to the Fedora 13 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update publican'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/publican-1.6.3-0.fc13

Comment 15 Fedora Update System 2010-05-17 18:54:59 UTC
publican-1.6.3-0.fc13 has been pushed to the Fedora 13 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 16 Fedora Update System 2010-05-17 18:58:53 UTC
publican-1.6.3-0.fc12 has been pushed to the Fedora 12 stable repository.  If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.