CNLiveConfigMacro.swift 1.39 KB
//
//  CNLiveConfigMacro.swift
//  metaCode
//
//  Created by open on 2023/5/31.
//

import Foundation
import UIKit

/// App 显示名称
let kAppDisplayName = Bundle.main.infoDictionary?["CFBundleDisplayName"] ?? ""
/// App BundleName
let kAppName = Bundle.main.infoDictionary![kCFBundleNameKey as String] ?? ""
/// App BundleID
let kAppBundleID = Bundle.main.bundleIdentifier ?? ""
/// App 版本号
let kAppVersion = Bundle.main.infoDictionary!["CFBundleShortVersionString"] ?? ""
/// App BuildNumber
let kAppBuildNumber = Bundle.main.object(forInfoDictionaryKey: kCFBundleVersionKey as String) ?? ""

/// App Language en
let kAPPLanguage = NSLocale.preferredLanguages[0]


let kApplication = UIApplication.shared
let keyWindow = UIApplication.shared.keyWindow
let appDelegate = UIApplication.shared.delegate
let userDefaults = UserDefaults.standard
let notificationCenter = NotificationCenter.default


// MARK: - 打印输出

/// 默认打印
public func log<T>(_ message: T) {
#if DEBUG
    print("\(message)")
#endif
}

/// 全部打印
public func aLog<T>(_ message: T, file: String = #file, funcName: String = #function, lineNum: Int = #line) {
#if DEBUG
    let fileName = (file as NSString).lastPathComponent
    print("\n********** JhAllLog-satrt ***********\n\n文件名称:\(fileName)\n方法名称:\(funcName)\n行数:\(lineNum)\n信息:\n\n\(message)\n\n********** JhAllLog-end ***********\n")
#endif
}