https://github.com/meniny/ealog
🖥 A tiny logging framework written in Swift.
https://github.com/meniny/ealog
log
Last synced: 2 months ago
JSON representation
🖥 A tiny logging framework written in Swift.
- Host: GitHub
- URL: https://github.com/meniny/ealog
- Owner: Meniny
- License: mit
- Created: 2018-06-06T06:57:29.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2018-06-06T08:42:33.000Z (about 8 years ago)
- Last Synced: 2025-02-22T23:46:53.153Z (over 1 year ago)
- Topics: log
- Language: Swift
- Homepage:
- Size: 173 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.adoc
- License: LICENSE.md
Awesome Lists containing this project
README
:name: EALog
:author: Elias Abel
:author_esc: Elias%20Abel
:mail: admin@meniny.cn
:desc: a tiny logging framework written in Swift.
:icon: {name}.png
:version: 1.0.0
:na: N/A
:ios: 8.0
:macos: 10.9
:watchos: 2.0
:tvos: 9.0
:linux: {na}
:xcode: 9.3
:swift: 4.1
:license: MIT
:sep: %20%7C%20
:platform: iOS{sep}macOS{sep}watchOS{sep}tvOS
// :toc: left
:toclevels: 6
:toc-title: TOC
:source-highlighter: highlightjs
// :source-highlighter: pygments
= Meet `{name}`
{author} <{mail}>
v{version}, 2018-06-06
[subs="attributes"]
++++
++++
:toc:
== 🏵 Introduction
**{name}** is {desc}.
== 📋 Requirements
[%header]
|===
2+^m|Type 1+^m|Requirement
1.5+^.^|Platform ^|iOS ^|{ios}+
^|macOS ^|{macos}
^|tvOS ^|{tvos}
^|watchOS ^|{watchos}
^|Linux ^|{linux}
^|IDE ^|Xcode ^| {xcode}+
^|Language ^|Swift ^| {swift}+
|===
== 📲 Installation
=== CocoaPods
`{name}` is available on link:https://cocoapods.org[CocoaPods].
[source, ruby, subs="verbatim,attributes"]
----
use_frameworks!
pod '{name}'
----
=== Manually
Copy all files in the `{name}` directory into your project.
== 🛌 Dependency
{na}
== ❤️ Contribution
You are welcome to fork and submit pull requests.
== 🔖 License
`{name}` is open-sourced software, licensed under the link:./LICENSE.md[`{license}`] license.
== 🔫 Usage
=== Basic
[source, swift, subs="verbatim,attributes"]
----
import UIKit
import {name}
let view = UIView.init()
let label = UILabel.init()
EALogger.info(view, label)
----
=== Custom Formatter
[source, swift, subs="verbatim,attributes"]
----
import Foundation
import {name}
class FakeFormatter: EALogFormatter {
let level: EALoggingLevel
init(_ l: EALoggingLevel = .verbose) {
level = l
}
var counter: UInt = 0
func log(_ type: EALoggingLevel, msg: [Any?], functionName: String, lineNum: Int, fileName: String) {
counter += 1
print("Fake Log Here, Yay! [NO.\(counter)]")
}
func isLogging(_ level: EALoggingLevel) -> Bool {
return level.rawValue >= self.level.rawValue
}
}
// then:
let formatter = FakeFormatter.init()
EALogger.formatter = formatter
EALogger.info("a string here to log")
----