Tambo is a versatile logging framework currently in development.
pod 'Tambo'
To start using Tambo
right away all you need to do is:
import Tambo
: this is usually done in yourAppDelegate
.- create a global constant with the
default
Tambo singleton like solet log = Tambo.default
. - start calling the logging api to se the logs in the Xcode console.
In order to use Tambo the way it's meant to be used, you need to create an instance with an identifier (helpful to track the logging source in complex application that could have multiple Tambo instances).
let log = Tambo(identifier: "com.my.logger")
Then you need to create a stream object which, in Tambo language, defines where you want the logs to be displayed/sent to. In this example let's create an Xcode console stream using the TConsoleStream
class:
let console = TConsoleStream(identifier: "com.my.console", printMode: .print)
Once we have created a stream we can configure it as much as we want and after that we're ready to add it to the Tambo
instance in order for it to start logging.
log.add(stream: console)
Now we're ready to show some logs to the console. YAY!! 🎉🎉🎉🎉
In priority order:
- error
- warning
- info
- debug
- verbose
Every log level has a correspondent method in the Tambo
class.
When you call that api you can pass anything as a first parameter and optionally a context
.
log.info("Request succeeded")
log.info(["one", "two", 3])
log.info(UIViewController(), context: ["url": request.url])
- CI integration
- Proven carthage support
- Linux testing
This framework is still in development you're welcome to
- try it out
- contribute
- submit issues/feature request