Giter VIP home page Giter VIP logo

Comments (6)

apmaros avatar apmaros commented on September 23, 2024

It depends on the perspective:

  • devops ENABLE_LOGA=true
  • devs ENABLE_LOGA=false

Devs perspective was prioritised over devops because of the frequency how often devs will install project. The idea was - "User should not noticed the library unless explicitly decide to". Also, I think that devops will write configuration anyway so can easily add it.

On the other hand having it setup to true by default will reduce probability of error, when the env var will be missing and thats much more important then dev settings.

I have no strong opinions about this and we can change it as you suggested

Thoughts? :)

from clj-loga.

rsslldnphy avatar rsslldnphy commented on September 23, 2024

Hmm, I guess the JSON would make it a bit annoying to read the logs.... I guess I don't have hugely strong feelings then, other than it's probably slightly easier to set an env var in dev than in uat/staging/production... (could be done in the project.clj) - and as you point out, having it default to true will reduce the probability of error.

from clj-loga.

stuart-robinson avatar stuart-robinson commented on September 23, 2024

Prefer to have sane defaults for developers. Its easy enough for the devops team to set environment variables.

from clj-loga.

rsslldnphy avatar rsslldnphy commented on September 23, 2024

Fair enough, closing this.

from clj-loga.

broi-fc avatar broi-fc commented on September 23, 2024

@stuart-robinson, @rsslldnphy - We had quite an issue recently with an internal application. In the end we failed to find anything and we lost decent amount of time because loga has been enabled in the code, but the environment variable was missing.

It is much harder for the developer to miss configuration in his local environment than missing configuration in production code. Also consequences are much more severe in the later case. This is a one-time setting that can be included in ~/.lein/profiles.clj file to be shared accross all the projects.

Another option - in development, we run applications using leiningen. Can we just upload the library to detect that leinigen is running? It sets up number of environment variables which does not appear in non-leiningen runs (LEIN_VERSION for example). Obviously it does not guarantee anything if someone decide to live without leiningen and will be a terrible idea if we ever had a moment of brilliance and run leiningen in prod, so I am sort of against my own idea here. :P

from clj-loga.

apmaros avatar apmaros commented on September 23, 2024

@broi-fc is right and this should be addressed. Loga can be dynamically allowed, or not based on environment variable and maybe if its not.

instead of

(defn- loga-enabled? []
  (= (env :enable-loga) "true"))

can be something like

(defn- loga-enabled? []
  (not= (env :lein_env) "dev"))

from clj-loga.

Related Issues (11)

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.