how to stop angular router events from printing on console










0















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



Picture of logs










share|improve this question
























  • 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















0















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



Picture of logs










share|improve this question
























  • 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













0












0








0








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



Picture of logs










share|improve this question
















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



Picture of logs







angular router console.log






share|improve this question















share|improve this question













share|improve this question




share|improve this question








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

















  • 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












2 Answers
2






active

oldest

votes


















0














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





share|improve this answer

























  • 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 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





    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


















0














In your Module search for :



 imports: [
RouterModule.forRoot(routes,
// this Debug options:
enableTracing: false
)
]


enableTracing should be false






share|improve this answer























  • 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










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
);



);













draft saved

draft discarded


















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









0














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





share|improve this answer

























  • 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 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





    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















0














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





share|improve this answer

























  • 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 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





    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













0












0








0







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





share|improve this answer















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






share|improve this answer














share|improve this answer



share|improve this answer








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 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





    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











  • 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







  • 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













0














In your Module search for :



 imports: [
RouterModule.forRoot(routes,
// this Debug options:
enableTracing: false
)
]


enableTracing should be false






share|improve this answer























  • 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















0














In your Module search for :



 imports: [
RouterModule.forRoot(routes,
// this Debug options:
enableTracing: false
)
]


enableTracing should be false






share|improve this answer























  • 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













0












0








0







In your Module search for :



 imports: [
RouterModule.forRoot(routes,
// this Debug options:
enableTracing: false
)
]


enableTracing should be false






share|improve this answer













In your Module search for :



 imports: [
RouterModule.forRoot(routes,
// this Debug options:
enableTracing: false
)
]


enableTracing should be false







share|improve this answer












share|improve this answer



share|improve this answer










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

















  • 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

















draft saved

draft discarded
















































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.




draft saved


draft discarded














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





















































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







Popular posts from this blog

How to how show current date and time by default on contact form 7 in WordPress without taking input from user in datetimepicker

Syphilis

Darth Vader #20