Swiftpack.co - Package - trifork/TriforkSwiftLogger

TriforkSwiftLogger

Swift

Installation ⬇️

Add https://github.com/trifork/TriforkSwiftLogger.git to your Xcode project file and start using TriforkLogger

Configuration

You can customize the default configuration for the logger by setting the config parameter. You can also mutate the default config by setting a single parameter on the TriforkLoggerConfig object.

MultiLogger

You can implement multiple LoggerProtocol classes and initialize a MultiLogger with multiple logger. The MultiLogger will invoke all loggers when logging.

If you have a logger, that is doing heavy load and prefers to be invoked on background thread, you can implement AsyncLoggerProtocol instead of the Logger protocol.

NOTE: The MultiLogger does not have any configurations. It is up to the LoggerProtocol implementation to handle the behaviour of the different logging functions.

Log

let logger = TriforkLogger()
logger.debug("Hello!", category: "my-custom-category")
logger.default("Hello!")
logger.info("Hello!")
logger.error("Hello!")
logger.fault("Hello!")

let multiLogger = MultiLogger(loggers: [TriforkLogger(), MyCustomLogger()])
multiLogger.info("Hello!", category: "my-custom-category") // the info-function will be invoked for both TriforkLogger and MyCustomLogger.

TRIFORK

Github

link
Stars: 0

Dependencies

Used By

Total: 0

Releases

1.0.0 - 2020-10-13 11:10:02

Initial release 🚀