Log
is a powerful logging framework that provides built-in themes and formatters, and a nice API to define your owns.
Get the most out of
Log
by installingXcodeColors
andKZLinkedConsole
Usage • Installation • License
Usage
The basics
- Use
Log
just as you would useprint
.

- Disable
Log
by settingenabled
tofalse
:
- Define a minimum level of severity to only print the messages with a greater or equal severity:
The severity levels are
trace
,debug
,info
,warning
, anderror
.
Customization
- Create your own
Logger
by changing itsTheme
and/orFormatter
.
A suggested way of doing it is by extending Formatters
and Themes
:

See the built-in formatters and themes for more examples.
Tip: Log.format
and Log.colors
can be useful to visually debug your logger.
Nothing prevents you from creating as many loggers as you want!

- Turn off the colors by setting the theme to
nil
:
Advanced
Include a custom Block
component in your formatter to print its result in every log message:
Installation
Carthage
Carthage is a decentralized dependency manager that automates the process of adding frameworks to your Cocoa application.
You can install Carthage with Homebrew using the following command:
To integrate Log into your Xcode project using Carthage, specify it in your Cartfile
:
CocoaPods
CocoaPods is a dependency manager for Cocoa projects.
You can install it with the following command:
To integrate Log into your Xcode project using CocoaPods, specify it in your Podfile
: