gopinath-langote / 1build

Frictionless way of managing project-specific commands

Home Page:https://1build.gitbook.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Discussion] pass log level of command as 1build flag

gopinath-langote opened this issue · comments

Description

  • With a framework like gradle, mvn, node - developer gets a choice to see only ERROR or WARN log as to avoid extra information printed on the console. It will be good if somehow we integrate such functionality in 1build.
  • example: 1build test --level error or 1build test --error-only

There are ways to do so –

  1. just analyze each line & see if it starts with ERROR , WARN etc (as most of the popular build tools print level in each line)
  2. Understand underline tool and integrate tools logging functionality with 1build - Which I am not a big fan of such tight coupling of tools.

Any other strategies are most welcome to discuss.

WDYT?
@landpro
@Ritabrata-TW
@themayurkumbhar
@RajatVaryani
@maniish-jaiin
@akhilbojedla

@gopinath-langote I think 1build should handle this in a way npm does it. 1build doesn't know about the underlying test command. So its better if 1build gets the param from the user and supply the same to the underlying command. For ex:

1build test | --log-level = error

we pass any params after the | to the underlying script set by the user.
Downside: will defeat the purpose of 1build, meaning the user has to remember which project they are in to pass the right flag ( npm or gradle or mvn)

Approach 2:

1build can define a set of standard options for the users to use. Have a map for the commonly used tools and their option. For ex:

1build option tool option
test level npm --level=%s
test level gradle level %s

users can call 1build command with 1build test level=ERROR then 1build takes care of detecting the users build tool and map the level to corresponding options.

The above data structure can be optimised for sure.. Just some random thought on top of my mind.

Hello @pradeepmurugesan

The later approach LGTM. Let's get others openion on this and we can move further on this topic.