Skip to content

feat: option to disable ANSI color codes #1520

@slayerjain

Description

@slayerjain

Is there an existing issue for this?

  • I have searched the existing issues

Current behavior

Currently when we are logging to places where ANSI color codes are not supported eg: piping to a file - the output is not readable. We use ANSI color codes to show colors in terminals, but they are not supported in log files and CI.

We should provide an option to disable ANSI color codes.

Steps to reproduce

  1. Record tests for any application with keploy.
  2. run testmode by pipping to a file. eg:keploy test -c "some app command" &> log.txt
  3. You will see random charaters appened instead of colors.

eg:

  TESTRUN SUMMARY. For testrun with id: �[31m�[1m"�[0m�[31mtest-set-0�[0m�[31m�[1m"�[0m
	Total tests: �[34m�[1m79�[0m
	Total test passed: �[34m�[1m66�[0m
	Total test failed: �[34m�[1m13�[0m
	```

### Environment

None

### Version

Cloud

### Repository

keploy

Metadata

Metadata

Assignees

No one assigned

    Labels

    EnhancementNew feature or requestGSoCIssues up for GSoCGoPull requests that update Go codeGood First IssueGood for newcomerskeploy

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions