NSLog output messages are repeated twice (duplicate) in the console
Asked Answered
M

1

7

WE had our existing project code base restructured, wherein a Static Library was separated out to be its own repository and it was added to the project as a submodule.
However, one of the issue we're facing is, duplicate print entries of log messages (all NSLog messages).
Before we restructured our project, logging to console had been fine and usual.
I've tried to look into sysLog and ASL documentation but I couldn't figure out what could be the issue.
Has anyone faced such an issue before?


I suppose this information should suffice, but if you need any more information let me know. I'm counting on that someone might have faced similar issue and has some solution or weird fix to it.


Thanks in advance.

Marketable answered 28/8, 2014 at 18:53 Comment(7)
just ignore it, or does it really bother youPostmaster
I've a feeling that it might be onset of some bigger issue due to restructuring ( or so it appears); I'm just curious to know why is it happening and would like assure that something related wouldn't wreck havoc later.Marketable
if you comment out a NSLog, does it remove both entries?Postmaster
I guess You can use NSLog(@"file = %s , line = %d", __FILE__, __LINE__); to find out exactly where they are coming from.Postmaster
Commenting out any of the log statements removes entry of messages from console too; and its just repeating the same log message twice, so file, method name, line number etc are all similar.Marketable
Did you ever find a solution to this? It's really clogging up my output making it difficult to read the logs.Makassar
In my case Console start duplicate messages after some network changes on device (enable/disable wifi for ex). After closing and reopen Console app, no duplicates, but also no old logs... :-/Portecochere
M
15

This happened to me (in 2020). Fixed by re-launching the Console app. Console got itself confused somehow.

Matthewmatthews answered 21/9, 2020 at 9:59 Comment(2)
Just happened to me, but it was showing each log 3 times!Flaviaflavian
I was using OSLog and had same issue. Xcode had one entry but Console had two. Relaunching console fixed the issue.Mumford

© 2022 - 2024 — McMap. All rights reserved.