Use colors for logging. #474

Merged
merged 4 commits into from Apr 19, 2016

Conversation

Projects
None yet
3 participants
Member

kyrofa commented Apr 19, 2016

This fixes LP: #1572186 by using the following colors:

  • INFO: Green
  • WARNING: Yellow
  • ERROR: Dark red
  • CRITICAL: Light red

kyrofa added some commits Apr 19, 2016

Use colors for logging.
This uses the following colors:

  - INFO: Green
  - WARNING: Yellow
  - ERROR: Dark red
  - CRITICAL: Light red

LP: #1572186

Signed-off-by: Kyle Fazzari <kyle@canonical.com>
- '\x1b[1m'
- 'Login {}.'.format(result) +
- '\x1b[0m\r\n')
+ process.expect_exact('Login {}.'.format(result))
def logout(self):
output = self.run_snapcraft('logout')
@elopio

elopio Apr 19, 2016

Member

This is a lot better, thanks.

+ 'WARNING': '\033[1;33m', # Yellow
+ 'ERROR': '\033[0;31m', # Dark red
+ 'CRITICAL': '\033[1;31m', # Light red
+ }
@elopio

elopio Apr 19, 2016

Member

These are constants. You should use upper case letters in the var name.

Fix upload integration tests by making them less rigid.
Signed-off-by: Kyle Fazzari <kyle@canonical.com>
Member

elopio commented Apr 19, 2016

👍
just a complaint about the var names of the constants.

Upper-case constants.
Signed-off-by: Kyle Fazzari <kyle@canonical.com>

@sergiusens sergiusens merged commit 675d200 into snapcore:master Apr 19, 2016

3 of 4 checks passed

Examples tests Started
Details
autopkgtest Success
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
coverage/coveralls Coverage increased (+0.07%) to 96.143%
Details

@kyrofa kyrofa deleted the kyrofa:bugfix/1572186/use_colors branch Apr 19, 2016

kalikiana pushed a commit to kalikiana/snapcraft that referenced this pull request Apr 6, 2017

Use colors for logging. (#474)
This uses the following colors:

  - INFO: Green
  - WARNING: Yellow
  - ERROR: Dark red
  - CRITICAL: Light red

LP: #1572186

Signed-off-by: Kyle Fazzari <kyle@canonical.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment