Skip to content

CLI does not output log messages from schematics #9976

Closed
@sebawita

Description

@sebawita

Versions

Angular CLI: 1.6.6
Node: 6.9.1
OS: darwin x64

Repro steps

Run the following schematic Rule, using AngularCLI:

export function params(options: any): Rule {
  return chain([
    // Step 1 - get appRoot => open .angular-cli.json -> get apps.root
    (tree: Tree, context: SchematicContext) => {
      context.logger.info('message'); // <--- this
      return tree;
    },
  ])
}

Observed behavior

Angular runs the schematic, but the message doesn't get logged.

Desired behavior

Message should be logged in the terminal.

Mention any other details that might be useful (optional)

I am not sure if this is relevant, but I am overriding the defaults->schematics->collection in my .angular-cli.json.
So that I could run it by calling ng g myrule

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions