Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Logs folder automatically created #207

Closed
1 of 2 tasks
Francois-BellegardeOSF opened this issue Feb 24, 2022 · 7 comments · Fixed by #971
Closed
1 of 2 tasks

[BUG] Logs folder automatically created #207

Francois-BellegardeOSF opened this issue Feb 24, 2022 · 7 comments · Fixed by #971
Assignees
Labels
bug Something isn't working e/Core EPIC
Milestone

Comments

@Francois-BellegardeOSF
Copy link

Francois-BellegardeOSF commented Feb 24, 2022

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

Whenever we run mcdev, even without parameters, a 'logs' folder is created.

Expected Behavior

A logs folder should only be created if something actually happens or is actually written.

I would also think that this log folders makes sense only in an initialized project.

Steps To Reproduce

  1. install the current version: npm i -g mcdev
  2. navigate to an empty folder
  3. Run mcdev
  4. Notice the new 'logs' folder that was created

Even running mcdev --version creates a 'logs' folder.

Version

3.1.3

Environment

  • OS: Windows/WSL/Linux
  • Node: 14.17.0, 14.18.2, 16.13.2
  • npm: 7.24.2, 8.3.0, 8.5.1

Participation

  • I am willing to submit a pull request for this issue.

Additional comments

No response

@Francois-BellegardeOSF Francois-BellegardeOSF added bug Something isn't working NEW not yet analyzed new issues get this label labels Feb 24, 2022
@JoernBerkefeld
Copy link
Contributor

hi @Francois-BellegardeOSF - how does this impact you? from my current POV you are right but I fail to see the actual issue that this is causing

@JoernBerkefeld JoernBerkefeld added question Further information is requested and removed NEW not yet analyzed new issues get this label labels Mar 23, 2022
@Francois-BellegardeOSF
Copy link
Author

It pollutes whatever location you call it from, even when you don't want to accomplish anything.

If you run even just mcdev --help from a location that is readonly, it shows an ugly unhandled error. I think at the very least it is a nuisance.

image

I'm simply reporting what I find.

@JoernBerkefeld
Copy link
Contributor

fair point, understanding it now :)
soooo basically we will should not create log files unless --debug flag was given or we find ourselves in an actual mcdev-project folder

@JoernBerkefeld JoernBerkefeld added e/Core EPIC and removed question Further information is requested labels Mar 23, 2022
@JoernBerkefeld JoernBerkefeld moved this to Todo in mcdev Mar 23, 2022
@JoernBerkefeld JoernBerkefeld added this to the 3.3.0 milestone Mar 23, 2022
@JoernBerkefeld
Copy link
Contributor

JoernBerkefeld commented Mar 28, 2022

fixing the folder creation will need a rewrite of how we start logging. Right now it's simply started upon requiring/loading Util.js. I don't think we'll tackle that before the next release but potentially in a patch soon after

the read-only dir issue is a problem that needs sorting inside of winston, which is the external module we use for logging

@JoernBerkefeld JoernBerkefeld self-assigned this Mar 28, 2022
@JoernBerkefeld JoernBerkefeld modified the milestones: 4.2.0 , 4.3.0 Nov 22, 2022
@JoernBerkefeld JoernBerkefeld modified the milestones: 5.6.0 , 5.1.0 Jun 6, 2023
@JoernBerkefeld
Copy link
Contributor

finally tackling this ticket to then fix #969 afterwards ;-)

@github-actions
Copy link

github-actions bot commented Jun 6, 2023

Closed by #971.

@github-actions github-actions bot closed this as completed Jun 6, 2023
@github-project-automation github-project-automation bot moved this from Todo to Done in mcdev Jun 6, 2023
@JoernBerkefeld
Copy link
Contributor

@Francois-BellegardeOSF quick note on how I tackled this: the access issue wasn't touched buy I simply made sure that commands that don't require a log file simply don't get one anymore, regardless of the folder you are in.
Every command that ends up writing into the current folder, however, does get a log file.

To avoid log files all together for, I suppose, other reasons, you can use --noLogFile from 5.1 on.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment