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

[FEATURE] Debug log in vscode's output tab #25

Closed
JoernBerkefeld opened this issue May 31, 2023 · 3 comments · Fixed by #59
Closed

[FEATURE] Debug log in vscode's output tab #25

JoernBerkefeld opened this issue May 31, 2023 · 3 comments · Fixed by #59
Assignees
Labels
Done enhancement New feature or request
Milestone

Comments

@JoernBerkefeld
Copy link
Contributor

JoernBerkefeld commented May 31, 2023

something like this:
image

watch out for the format:

2023-05-31 11:41:45.945 [info] message

possible types (assumed):

  • info
  • warning
  • error
  • debug (not sure if this is supported by the color coding)

Code sample:

   //Create output channel
    let orange = vscode.window.createOutputChannel("Orange");

    //Write to output.
    orange.appendLine("I am a banana.");

Docs:

@JoernBerkefeld JoernBerkefeld added enhancement New feature or request NEW not yet analyzed new issues get this label and removed NEW not yet analyzed new issues get this label labels May 31, 2023
@JoernBerkefeld
Copy link
Contributor Author

JoernBerkefeld commented May 31, 2023

ensure to change the working directory to the current project's root : https://stackoverflow.com/a/64726585/818732

--> keep in mind that the variable vsc returns is likely an array

process.chdir(whateverVSCreturned);
Log.debug(process.cwd());

@JoernBerkefeld
Copy link
Contributor Author

just in case users have multiple project folders open, you should always match whatever path you get from a context menu execution to then be able to switch the current working directory to the right root folder!

mcdev expected to be executed in the root folder of a project because that's where it will look for the config file .mcdevrc.json and .mcdev-auth.json

@JoernBerkefeld
Copy link
Contributor Author

as expected, running any context-menu related commands wont bother checking or changing the working directory but simply take whatever terminal is currently open, paste & execute the relevant command. that ends in the following error:

image

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