Code Monkey home page Code Monkey logo

echelon's People

Contributors

edigaryev avatar fkorotkov avatar mightyguava avatar psihachina avatar zyga avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

echelon's Issues

Ugly output in short terminal windows

Seems there is an issue when terminal window doesn't have too many lines available. Reported from this Reddit comment:

Ah echelon tries to keep the job levels at the top of the currently-visible portion of the console, this is interesting. This only is an issue in case there are too many log lines. This makes the output very ugly though, apart from the last few lines. Just try the demo with passing false to all log.Finish calls.

Example for the issue:

๐Ÿ•’ Job 1 37s
๐Ÿ•’ Job 1 38s
   โŒ Job 4 8.0s
๐Ÿ•’ Job 1 39s
      Doing very important jobs! Completed 25/100...
๐Ÿ•’ Job 1 40s
๐Ÿ•’ Job 1 41s
๐Ÿ•’ Job 1 42s
๐Ÿ•’ Job 1 43s
      Doing very important jobs! Completed 87/100...
๐Ÿ•’ Job 1 44s
      
๐Ÿ•’ Job 1 45s
๐Ÿ•’ Job 1 46s
๐Ÿ•’ Job 1 47s
๐Ÿ•’ Job 1 48s
๐Ÿ•’ Job 1 49s
   โŒ Job 8 9.0s

Add Simple Renderer Without Using ANSI Color

Issue

Using current NewSimpleRenderer, if we pipe or log it to file it will print the ANSI color codes.
image

So for my use case, I want to use NewInteractiveRenderer in my development and use NewSimpleRenderer in the production but it will print ANSI color codes in the log.

Expected

image

Related PR #18.

Support status customization

Right now it's only possible to configure colors and progress indicator. Once there are more cases of echelon usage we need think of a generic way for customization of scope statuses. (replace โœ… and โŒ with something different)

Data race

I have some unit tests on some code that uses echelon and it spit this out with -race.

Looks like the len(node.Children) at https://github.com/cirruslabs/echelon/blob/master/renderers/internal/node/echelone_node.go#L134 needs to be protected by mutex.

==================
WARNING: DATA RACE
Write at 0x00c0001386a8 by goroutine 10:
  github.com/cirruslabs/echelon/renderers/internal/node.(*EchelonNode).FindOrCreateChild()
      /data/app/kochiku-worker/go/pkg/mod/github.com/cirruslabs/[email protected]/renderers/internal/node/echelone_node.go:194 +0x2bd
  github.com/cirruslabs/echelon/renderers.findScopedNode()
      /data/app/kochiku-worker/go/pkg/mod/github.com/cirruslabs/[email protected]/renderers/interactive.go:43 +0xb0
  github.com/cirruslabs/echelon/renderers.(*InteractiveRenderer).RenderScopeStarted()
      /data/app/kochiku-worker/go/pkg/mod/github.com/cirruslabs/[email protected]/renderers/interactive.go:49 +0x67
  github.com/cirruslabs/echelon.(*Logger).streamEntries()
      /data/app/kochiku-worker/go/pkg/mod/github.com/cirruslabs/[email protected]/logger.go:46 +0x182

Previous read at 0x00c0001386a8 by goroutine 9:
  github.com/cirruslabs/echelon/renderers/internal/node.(*EchelonNode).fancyTitle()
      /data/app/kochiku-worker/go/pkg/mod/github.com/cirruslabs/[email protected]/renderers/internal/node/echelone_node.go:134 +0x82
  github.com/cirruslabs/echelon/renderers/internal/node.(*EchelonNode).Render()
      /data/app/kochiku-worker/go/pkg/mod/github.com/cirruslabs/[email protected]/renderers/internal/node/echelone_node.go:100 +0x6a
  github.com/cirruslabs/echelon/renderers.(*InteractiveRenderer).DrawFrame()
      /data/app/kochiku-worker/go/pkg/mod/github.com/cirruslabs/[email protected]/renderers/interactive.go:94 +0x1aa
  github.com/cirruslabs/echelon/renderers.(*InteractiveRenderer).StartDrawing()
      /data/app/kochiku-worker/go/pkg/mod/github.com/cirruslabs/[email protected]/renderers/interactive.go:75 +0x74
=================

NewInteractiveRenderer takes a os.File instead of a io.Writer

There is no logic in NewInteractiveRenderer() that depends on out being a file, but unfortunately this can't be changed without a 2.x release. Can an additional function be added to handle this case? I can submit the PR for it

func NewInteractiveRenderer2(out io.Writer, rendererConfig *config.InteractiveRendererConfig) *InteractiveRenderer

...

Thank you.
That is all ๐Ÿ™ƒ

Example code for SimpleRenderer

I am relatively new to Go, and am having trouble understanding how to use the SimpleRenderer. Can you please provide some example code?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.