how to stop angular router events from printing on console
I am making an angular app and am using the RouterModule from @angular/router
.
I use the console.log to debug my Application, but since I started using the router module, it has started spamming the console with router events, which makes it hard to see my actual logs.
How can I stop angular router events from printing on console?
Edit 1: Picture of logs
angular router console.log
add a comment |
I am making an angular app and am using the RouterModule from @angular/router
.
I use the console.log to debug my Application, but since I started using the router module, it has started spamming the console with router events, which makes it hard to see my actual logs.
How can I stop angular router events from printing on console?
Edit 1: Picture of logs
angular router console.log
What kind of routing events are showing in console?
– Pardeep Jain
Nov 14 '18 at 6:56
I have shared a screenshot of logs in the edit.
– user8401765
Nov 14 '18 at 7:03
add a comment |
I am making an angular app and am using the RouterModule from @angular/router
.
I use the console.log to debug my Application, but since I started using the router module, it has started spamming the console with router events, which makes it hard to see my actual logs.
How can I stop angular router events from printing on console?
Edit 1: Picture of logs
angular router console.log
I am making an angular app and am using the RouterModule from @angular/router
.
I use the console.log to debug my Application, but since I started using the router module, it has started spamming the console with router events, which makes it hard to see my actual logs.
How can I stop angular router events from printing on console?
Edit 1: Picture of logs
angular router console.log
angular router console.log
edited Nov 14 '18 at 7:02
asked Nov 14 '18 at 6:55
user8401765
What kind of routing events are showing in console?
– Pardeep Jain
Nov 14 '18 at 6:56
I have shared a screenshot of logs in the edit.
– user8401765
Nov 14 '18 at 7:03
add a comment |
What kind of routing events are showing in console?
– Pardeep Jain
Nov 14 '18 at 6:56
I have shared a screenshot of logs in the edit.
– user8401765
Nov 14 '18 at 7:03
What kind of routing events are showing in console?
– Pardeep Jain
Nov 14 '18 at 6:56
What kind of routing events are showing in console?
– Pardeep Jain
Nov 14 '18 at 6:56
I have shared a screenshot of logs in the edit.
– user8401765
Nov 14 '18 at 7:03
I have shared a screenshot of logs in the edit.
– user8401765
Nov 14 '18 at 7:03
add a comment |
2 Answers
2
active
oldest
votes
As shown in the attached screenshot you should need to Enable production mode for your angular application to avoid these logs
(As angular application run in development mode by default).
Just put this piece code in your main.ts file before calling bootstrapping of your application -
import enableProdMode from '@angular/core';
enableProdMode();
bootstrap(....);
update
Search enableTracing
keyword in your routing file, either remove it or set it to false.
enableTracing: false
For more info , refer here -
- https://angular.io/api/router/RouterModule#forroot
It didn't work. It's still printing the logs.
– user8401765
Nov 14 '18 at 7:11
have you restart your application from console? it should work.
– Pardeep Jain
Nov 14 '18 at 7:11
I did. And I ran it in both chrome and Firefox to be sure it's not a browser thing. I'm usingng serv
to run the application, in case that helps. The logs seem to come from some platform-browser.js
– user8401765
Nov 14 '18 at 7:16
1
It's working in the new project, There must be some problem with my current project. I'll look for that.
– user8401765
Nov 14 '18 at 8:11
1
Found the error, there was another definition of a router with enableTracing true.
– user8401765
Nov 14 '18 at 9:17
|
show 3 more comments
In your Module search for :
imports: [
RouterModule.forRoot(routes,
// this Debug options:
enableTracing: false
)
]
enableTracing
should be false
I have already covered this in my answer, something new?
– Pardeep Jain
Nov 14 '18 at 7:26
oh you updated your answer.. May not..only specify where he can search for the debug option
– billyjov
Nov 14 '18 at 7:30
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53294624%2fhow-to-stop-angular-router-events-from-printing-on-console%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
As shown in the attached screenshot you should need to Enable production mode for your angular application to avoid these logs
(As angular application run in development mode by default).
Just put this piece code in your main.ts file before calling bootstrapping of your application -
import enableProdMode from '@angular/core';
enableProdMode();
bootstrap(....);
update
Search enableTracing
keyword in your routing file, either remove it or set it to false.
enableTracing: false
For more info , refer here -
- https://angular.io/api/router/RouterModule#forroot
It didn't work. It's still printing the logs.
– user8401765
Nov 14 '18 at 7:11
have you restart your application from console? it should work.
– Pardeep Jain
Nov 14 '18 at 7:11
I did. And I ran it in both chrome and Firefox to be sure it's not a browser thing. I'm usingng serv
to run the application, in case that helps. The logs seem to come from some platform-browser.js
– user8401765
Nov 14 '18 at 7:16
1
It's working in the new project, There must be some problem with my current project. I'll look for that.
– user8401765
Nov 14 '18 at 8:11
1
Found the error, there was another definition of a router with enableTracing true.
– user8401765
Nov 14 '18 at 9:17
|
show 3 more comments
As shown in the attached screenshot you should need to Enable production mode for your angular application to avoid these logs
(As angular application run in development mode by default).
Just put this piece code in your main.ts file before calling bootstrapping of your application -
import enableProdMode from '@angular/core';
enableProdMode();
bootstrap(....);
update
Search enableTracing
keyword in your routing file, either remove it or set it to false.
enableTracing: false
For more info , refer here -
- https://angular.io/api/router/RouterModule#forroot
It didn't work. It's still printing the logs.
– user8401765
Nov 14 '18 at 7:11
have you restart your application from console? it should work.
– Pardeep Jain
Nov 14 '18 at 7:11
I did. And I ran it in both chrome and Firefox to be sure it's not a browser thing. I'm usingng serv
to run the application, in case that helps. The logs seem to come from some platform-browser.js
– user8401765
Nov 14 '18 at 7:16
1
It's working in the new project, There must be some problem with my current project. I'll look for that.
– user8401765
Nov 14 '18 at 8:11
1
Found the error, there was another definition of a router with enableTracing true.
– user8401765
Nov 14 '18 at 9:17
|
show 3 more comments
As shown in the attached screenshot you should need to Enable production mode for your angular application to avoid these logs
(As angular application run in development mode by default).
Just put this piece code in your main.ts file before calling bootstrapping of your application -
import enableProdMode from '@angular/core';
enableProdMode();
bootstrap(....);
update
Search enableTracing
keyword in your routing file, either remove it or set it to false.
enableTracing: false
For more info , refer here -
- https://angular.io/api/router/RouterModule#forroot
As shown in the attached screenshot you should need to Enable production mode for your angular application to avoid these logs
(As angular application run in development mode by default).
Just put this piece code in your main.ts file before calling bootstrapping of your application -
import enableProdMode from '@angular/core';
enableProdMode();
bootstrap(....);
update
Search enableTracing
keyword in your routing file, either remove it or set it to false.
enableTracing: false
For more info , refer here -
- https://angular.io/api/router/RouterModule#forroot
edited Nov 14 '18 at 7:20
answered Nov 14 '18 at 7:05
Pardeep JainPardeep Jain
41.1k17103145
41.1k17103145
It didn't work. It's still printing the logs.
– user8401765
Nov 14 '18 at 7:11
have you restart your application from console? it should work.
– Pardeep Jain
Nov 14 '18 at 7:11
I did. And I ran it in both chrome and Firefox to be sure it's not a browser thing. I'm usingng serv
to run the application, in case that helps. The logs seem to come from some platform-browser.js
– user8401765
Nov 14 '18 at 7:16
1
It's working in the new project, There must be some problem with my current project. I'll look for that.
– user8401765
Nov 14 '18 at 8:11
1
Found the error, there was another definition of a router with enableTracing true.
– user8401765
Nov 14 '18 at 9:17
|
show 3 more comments
It didn't work. It's still printing the logs.
– user8401765
Nov 14 '18 at 7:11
have you restart your application from console? it should work.
– Pardeep Jain
Nov 14 '18 at 7:11
I did. And I ran it in both chrome and Firefox to be sure it's not a browser thing. I'm usingng serv
to run the application, in case that helps. The logs seem to come from some platform-browser.js
– user8401765
Nov 14 '18 at 7:16
1
It's working in the new project, There must be some problem with my current project. I'll look for that.
– user8401765
Nov 14 '18 at 8:11
1
Found the error, there was another definition of a router with enableTracing true.
– user8401765
Nov 14 '18 at 9:17
It didn't work. It's still printing the logs.
– user8401765
Nov 14 '18 at 7:11
It didn't work. It's still printing the logs.
– user8401765
Nov 14 '18 at 7:11
have you restart your application from console? it should work.
– Pardeep Jain
Nov 14 '18 at 7:11
have you restart your application from console? it should work.
– Pardeep Jain
Nov 14 '18 at 7:11
I did. And I ran it in both chrome and Firefox to be sure it's not a browser thing. I'm using
ng serv
to run the application, in case that helps. The logs seem to come from some platform-browser.js– user8401765
Nov 14 '18 at 7:16
I did. And I ran it in both chrome and Firefox to be sure it's not a browser thing. I'm using
ng serv
to run the application, in case that helps. The logs seem to come from some platform-browser.js– user8401765
Nov 14 '18 at 7:16
1
1
It's working in the new project, There must be some problem with my current project. I'll look for that.
– user8401765
Nov 14 '18 at 8:11
It's working in the new project, There must be some problem with my current project. I'll look for that.
– user8401765
Nov 14 '18 at 8:11
1
1
Found the error, there was another definition of a router with enableTracing true.
– user8401765
Nov 14 '18 at 9:17
Found the error, there was another definition of a router with enableTracing true.
– user8401765
Nov 14 '18 at 9:17
|
show 3 more comments
In your Module search for :
imports: [
RouterModule.forRoot(routes,
// this Debug options:
enableTracing: false
)
]
enableTracing
should be false
I have already covered this in my answer, something new?
– Pardeep Jain
Nov 14 '18 at 7:26
oh you updated your answer.. May not..only specify where he can search for the debug option
– billyjov
Nov 14 '18 at 7:30
add a comment |
In your Module search for :
imports: [
RouterModule.forRoot(routes,
// this Debug options:
enableTracing: false
)
]
enableTracing
should be false
I have already covered this in my answer, something new?
– Pardeep Jain
Nov 14 '18 at 7:26
oh you updated your answer.. May not..only specify where he can search for the debug option
– billyjov
Nov 14 '18 at 7:30
add a comment |
In your Module search for :
imports: [
RouterModule.forRoot(routes,
// this Debug options:
enableTracing: false
)
]
enableTracing
should be false
In your Module search for :
imports: [
RouterModule.forRoot(routes,
// this Debug options:
enableTracing: false
)
]
enableTracing
should be false
answered Nov 14 '18 at 7:24
billyjovbillyjov
800316
800316
I have already covered this in my answer, something new?
– Pardeep Jain
Nov 14 '18 at 7:26
oh you updated your answer.. May not..only specify where he can search for the debug option
– billyjov
Nov 14 '18 at 7:30
add a comment |
I have already covered this in my answer, something new?
– Pardeep Jain
Nov 14 '18 at 7:26
oh you updated your answer.. May not..only specify where he can search for the debug option
– billyjov
Nov 14 '18 at 7:30
I have already covered this in my answer, something new?
– Pardeep Jain
Nov 14 '18 at 7:26
I have already covered this in my answer, something new?
– Pardeep Jain
Nov 14 '18 at 7:26
oh you updated your answer.. May not..only specify where he can search for the debug option
– billyjov
Nov 14 '18 at 7:30
oh you updated your answer.. May not..only specify where he can search for the debug option
– billyjov
Nov 14 '18 at 7:30
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53294624%2fhow-to-stop-angular-router-events-from-printing-on-console%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
What kind of routing events are showing in console?
– Pardeep Jain
Nov 14 '18 at 6:56
I have shared a screenshot of logs in the edit.
– user8401765
Nov 14 '18 at 7:03