Skip to content

Duplicate logs getting generated  #327

@LoydAntony

Description

@LoydAntony

Duplicate logs getting created

Issue

When we added the log in the code, the logs are getting created twice. I have tried adding the log on Delegate its still printing the logs twice in the console.

  • Xcode: 14.2 (Rosetta)
  • XCGLogger version: 7.2.0
  • swift: 5
Screenshot 2023-06-09 at 8 11 59 PM

enabledDestinations.count is 3 for one log registered which is printing two message on the console.

Screenshot 2023-06-09 at 8 19 08 PM

You can see the console the message Theater loaded successfully 🎉 theater: is printed twice on the console.
The LOG is triggered only once in the code.
But in the XCLogger Class the function

open func logln(_ level: Level = .debug, functionName: String = #function, fileName: String = #file, lineNumber: Int = #line, userInfo: [String: Any] = [:], closure: () -> Any?)

is creating duplicate logs in the terminal, which is causing issue in debugging the source code.

It looks like there is bug in the login function which is causing the logs to get generated twice.

Required Result

Print the log only once in the terminal and do not create duplicate of it

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions