{"id":22455690,"url":"https://github.com/theapache64/log","last_synced_at":"2025-07-30T12:10:45.839Z","repository":{"id":56932271,"uuid":"131717072","full_name":"theapache64/Log","owner":"theapache64","description":"iOS alternative for Android's Log class","archived":false,"fork":false,"pushed_at":"2019-11-14T06:27:07.000Z","size":40,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-01T21:01:52.662Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/theapache64.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-05-01T13:37:25.000Z","updated_at":"2023-12-31T12:43:23.000Z","dependencies_parsed_at":"2022-08-21T05:50:31.653Z","dependency_job_id":null,"html_url":"https://github.com/theapache64/Log","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theapache64%2FLog","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theapache64%2FLog/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theapache64%2FLog/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theapache64%2FLog/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/theapache64","download_url":"https://codeload.github.com/theapache64/Log/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245850357,"owners_count":20682647,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-06T07:13:08.468Z","updated_at":"2025-03-27T13:18:36.603Z","avatar_url":"https://github.com/theapache64.png","language":"Swift","readme":"# Log\niOS alternative for Android's Log class, which prints beautiful log messages\n\n## Methods\n\n```swift\nLog.i(message : Any)\nLog.d(message : Any)\nLog.w(message : Any)\nLog.e(message : Any)\nLog.f(message : Any)\nLog.with(key: String, value: String)\n```\n## Log.swift\n\n```swift\n//\n//  Log.swift\n//  Banjos\n//\n//  Created by theapache64 on 28/04/18.\n//  Copyright © 2018 cybaze. All rights reserved.\n//\n\nimport Foundation\n\n\npublic class Log {\n    \n    //Type emojis\n    public static var FATAL_EMOJI = \"💔\"\n    public static var ERROR_EMOJI = \"❤️\"\n    public static var DEBUG_EMOJI = \"💙\"\n    public static var INFO_EMOJI = \"💚\"\n    public static var WARNING_EMOJI = \"🧡\"\n    public static var VERBOSE_EMOJI = \"🖤\"\n    \n    private static let TIME_FORMAT = \"hh:mm:ss:SSS\"\n    \n    //Returns current date\n    private static var dateTime: String {\n        let formatter = DateFormatter()\n        formatter.dateFormat = TIME_FORMAT\n        formatter.locale = Locale.current\n        formatter.timeZone = TimeZone.current\n        return formatter.string(from: Date())\n    }\n    \n    \n    public static func with(key: String, value: String,\n                            fileName: String = #file,\n                            functionName: String = #function,\n                            line: Int = #line) {\n        Log.d(\"\\(key) : \\(value)\",fileName: fileName, functionName: functionName,line: line)\n    }\n    \n    \n    /// Debug log\n    ///\n    /// - Parameter message: Message to be displayed\n    public static func d(_ message: Any?,\n                         fileName: String = #file,\n                         functionName: String = #function,\n                         line: Int = #line) {\n        printIt(emoji: DEBUG_EMOJI, message: message, fileName: fileName, functionName: functionName, line: line)\n    }\n    \n    /// Error log\n    ///\n    /// - Parameter message: Message to be displayed\n    public static func e(_ message: Any?,\n                         fileName: String = #file,\n                         functionName: String = #function,\n                         line: Int = #line) {\n        printIt(emoji: ERROR_EMOJI, message: message, fileName: fileName, functionName: functionName, line: line)\n    }\n    \n    /// Info log\n    ///\n    /// - Parameter message: Message to be displayed\n    public static func i(_ message: Any?,\n                         fileName: String = #file,\n                         functionName: String = #function,\n                         line: Int = #line) {\n        printIt(emoji: INFO_EMOJI, message: message, fileName: fileName, functionName: functionName, line: line)\n    }\n    \n    /// Warning log\n    ///\n    /// - Parameter message: Message to be displayed\n    public static func w(_ message: Any?,\n                         fileName: String = #file,\n                         functionName: String = #function,\n                         line: Int = #line) {\n        printIt(emoji: WARNING_EMOJI, message: message, fileName: fileName, functionName: functionName, line: line)\n    }\n    \n    /// Verbose log\n    ///\n    /// - Parameter message: Message to be displayed\n    public static func v(_ message: Any?,\n                         fileName: String = #file,\n                         functionName: String = #function,\n                         line: Int = #line) {\n        printIt(emoji: VERBOSE_EMOJI, message: message, fileName: fileName, functionName: functionName, line: line)\n    }\n    \n    \n    \n    /// Fatal log\n    ///\n    /// - Parameter message: Message to be displayed\n    public static func f(_ message: Any?,\n                         fileName: String = #file,\n                         functionName: String = #function,\n                         line: Int = #line) {\n        printIt(emoji: FATAL_EMOJI, message: message, fileName: fileName, functionName: functionName, line: line)\n    }\n    \n    private static func printIt(emoji: String, message: Any?, fileName: String, functionName: String, line: Int) {\n        \n        #if DEBUG\n        \n        print(\"\\(emoji):\\(getLoggedFrom(fileName: fileName, functionName: functionName, line: line))[\\(dateTime)] : \\(message ?? \"nil\")\")\n        \n        #endif\n        \n        \n    }\n    \n    \n    /// To get logged from position\n    ///\n    /// - Returns: String with format fileName:methodName:lineNumber\n    private static func getLoggedFrom(fileName: String, functionName: String, line: Int) -\u003e String {\n        return \"\\((fileName as NSString).lastPathComponent)@\\(functionName)#\\(line)\"\n    }\n}\n\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftheapache64%2Flog","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftheapache64%2Flog","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftheapache64%2Flog/lists"}