- Notifications
You must be signed in to change notification settings - Fork1
A pretty set of log functions to print message in console using levels and emojis to improve visibility 💪
License
hyperdevs-team/PrettyLogger
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
A pretty set of log functions to print message in console using levels (Debug, Info, Trace, Warning & Error) and emojis to improve visibility 💪
Support for iOS, tvOS and macOS
For Swift 4 please use v1
For Swift 5 please use v2+
PrettyLogger is available throughSwift Package Manager.
- Follow Apple'sAdding Package Dependencies to Your App guide on how to add a Swift Package dependency.
- Use
https://github.com/hyperdevs-team/PrettyLoggeras the repository URL. - Specify the version to be at least
3.0.0.
To print a message in the console you simply use any of the global functions:
logWarning("This a warning!!")logError("This is showed as error")logFatal("This is showed as fatal message")logInfo("This is an info message")logDebug("This is a debug message")logTrace("This is a trace info")
The previous example will print:
13:31:59.632 ◉ ⚠️⚠️⚠️ This a warning!! [File.swift:L109]13:31:59.639 ◉ ❌❌❌ This is showed as error [File.swift:L110]13:31:59.639 ◉ ☠️☠️☠️ This is showed as fatal message [File.swift:L111]13:31:59.639 ◉ 🔍 This is an info message [File.swift:L112]13:31:59.639 ◉ 🐛 This is a debug message [File.swift:L113]13:31:59.640 ◉ ✏️ This is a trace info [File.swift:L114]You can silent all logs (or some, depending on level) by setting the propertylevel on the shared instance:
PrettyLogger.shared.level=.all //To show all messagesPrettyLogger.shared.level=.disable //To silent loggerPrettyLogger.shared.level=.info //To show all message except debug & trace
The available levels, in order, are: disable, fatal, error, warn, info, debug, trace & all
If you want to import all functions in your project without import PrettyLogger in every file you could use this directive in your AppDelegate:
@_exportedimport PrettyLogger
About
A pretty set of log functions to print message in console using levels and emojis to improve visibility 💪
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Uh oh!
There was an error while loading.Please reload this page.