5

I have a XCode project which builds an executable (swift package init --type executable && swift package generate-xcodeproj). The executable imports a framework which normally logs messages to the console, but because the framework is imported by the executable the log messages are not shown.

How can I display log messages (Log.debug("Bla bla")) from inside a module/framework invoked by an executable in the XCode console?

sluijs
  • 4,146
  • 4
  • 30
  • 36

1 Answers1

0

As this thread mentioned:

It isn’t designed for that sort of thing, because once the package is a dependency, it might be loaded multiple times for different versions while the dependency graph is being resolved—even multiple times at once.

If you are trying to debug something, swift package has subcommands like describe, dump‐package and show-dependencies. swift package --help will show you the complete list of available commands.

samthui7
  • 923
  • 2
  • 12
  • 11