2

I'm writing custum angular upgrade schematics.

The SchematicContext contains a logger object which can be usefull to debug.

 context.logger.debug('This logger seems to be usefull!');   

Running angular-cli, my code is executed but I can't see the logs.

Is there a mean to activate and configure this logger ?

3 Answers 3

1

I dont think debug is visible by default level of logging. Trying changing logging level to info or above.

Sign up to request clarification or add additional context in comments.

1 Comment

Any reason why debug wouldn't be visible? I tried going through the source code and couldn't see any difference with the debug method vs info, warn, etc.
1

The help says to use --verbose but it doesn't work.

$ ng add --help
options:
  --verbose 
    Display additional details about internal operations during execution.

The proper solution is to set the env variable NG_DEBUG to true.

# On macOS:
$ NG_DEBUG=true ng add @scope/my-schematic

Comments

0

I also can't get .debug to do anything. The other methods work, though: warn, error, info, etc., so at least those are useful. Just be sure to run "yarn build" before running it.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.