EALog 1.0.0

EALog 1.0.0

Maintained by Meniny.



EALog 1.0.0

Meet EALog

EALog

Author EMail MIT
Version Platforms Swift
Build Passing Cocoapods Carthage SPM

🏵 Introduction

EALog is a tiny logging framework written in Swift..

📋 Requirements

Type Requirement

Platform

iOS

8.0+

macOS

10.9

tvOS

9.0

watchOS

2.0

Linux

N/A

IDE

Xcode

9.3+

Language

Swift

4.1+

📲 Installation

CocoaPods

EALog is available on CocoaPods.

use_frameworks!
pod 'EALog'

Manually

Copy all files in the EALog directory into your project.

🛌 Dependency

N/A

❤️ Contribution

You are welcome to fork and submit pull requests.

🔖 License

EALog is open-sourced software, licensed under the MIT license.

🔫 Usage

Basic

import UIKit
import EALog

let view = UIView.init()
let label = UILabel.init()

EALogger.info(view, label)

Custom Formatter

import Foundation
import EALog

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")