logToSystem (Bool): parameter for write log in system log console or not. Default is FALSE.
category (enum): the log category options:
public enum LogCategory: String {
case success = "✅✅"
case info = "ℹ️ℹ️"
case warning = "⚠️⚠️"
case error = "🧨🧨"
case viewcycle = "📱📱"
case data = "🗄🗄"
case service = "📬📬"
case trace = "🔸🔸"
}
type (OSLogType): type of OSLog for system console.
╔═══╗──────╔╗────╔╗ ║╔═╗║──────║║────║║ ║╚══╦╦╗╔╦══╣║╔╗─╔╣║──╔══╦══╦══╦══╦═╗ ╚══╗╠╣╚╝║╔╗║║║║─║║║─╔╣╔╗║╔╗║╔╗║║═╣╔╝ ║╚═╝║║║║║╚╝║╚╣╚═╝║╚═╝║╚╝║╚╝║╚╝║║═╣║ ╚═══╩╩╩╩╣╔═╩═╩═╗╔╩═══╩══╩═╗╠═╗╠══╩╝ ────────║║───╔═╝║───────╔═╝╠═╝║ ────────╚╝───╚══╝───────╚══╩══╝
Installation
Use Swift Package Manager to add this package to your project.
Definition & Interface
str (String): logging message
appName (String): app name to show at log header.
identity (String): name of log.
logToSystem (Bool): parameter for write log in system log console or not. Default is FALSE.
category (enum): the log category options:
type (OSLogType): type of OSLog for system console.
log (OSLog): the log write.
Usage example
Custom Log
Logging traces
Also, you can do a complex trace using custom log with “trace” category.
Meta
David Martin Saiz – @deividmarshall – davms81@gmail.com
Distributed under the MIT license. See
LICENSE
for more information.https://github.com/CodeNationDev/
Version History