diff --git a/DiscoveryProject/DarkModeDiscovery/AppGlobals.swift b/DiscoveryProject/DarkModeDiscovery/AppGlobals.swift index 9475c2f..ac8e09f 100644 --- a/DiscoveryProject/DarkModeDiscovery/AppGlobals.swift +++ b/DiscoveryProject/DarkModeDiscovery/AppGlobals.swift @@ -73,3 +73,16 @@ struct AppGlobals { } } } + +func loadJsonLogProfile(_ name: String) -> (status: Bool, info: String) { + + if let path = Bundle.main.url(forResource: name, withExtension: "json") { + if log.loadConfig(path), DM_LOG.loadConfig(path), GEO_LOG.loadConfig(path) { + return (true, "Options successfully reseted") + } else { + return (false, "Failed to reset options") + } + } else { + return (false, "Failed to create URL") + } +} diff --git a/DiscoveryProject/DarkModeDiscovery/Configuration/FirstPartyCode/MessageLabel.swift b/DiscoveryProject/DarkModeDiscovery/Configuration/FirstPartyCode/MessageLabel.swift index 6bc9351..14dd2ee 100644 --- a/DiscoveryProject/DarkModeDiscovery/Configuration/FirstPartyCode/MessageLabel.swift +++ b/DiscoveryProject/DarkModeDiscovery/Configuration/FirstPartyCode/MessageLabel.swift @@ -56,7 +56,7 @@ public typealias MyCustomLabel = NSTextField public let DEFAULT_MESSAGE_LABEL_TEXT = "Have a great time" -public class MessageLabel: MyCustomLabel, PerseusDelegatedMessage { +public class MessageLabel: MyCustomLabel, ConsolePerseusLogger.PerseusDelegatedMessage { private var messageDeepCounter: Int = 0 diff --git a/DiscoveryProject/DarkModeDiscovery/main.swift b/DiscoveryProject/DarkModeDiscovery/main.swift index 1539376..d3d688e 100644 --- a/DiscoveryProject/DarkModeDiscovery/main.swift +++ b/DiscoveryProject/DarkModeDiscovery/main.swift @@ -13,67 +13,44 @@ import ConsolePerseusLogger import class PerseusDarkMode.PerseusLogger import class PerseusGeoKit.PerseusLogger +import struct PerseusDarkMode.LogMessage +import struct PerseusGeoKit.LogMessage + // swiftlint:disable type_name typealias DM_LOG = PerseusDarkMode.PerseusLogger typealias GEO_LOG = PerseusGeoKit.PerseusLogger // swiftlint:enable type_name -// MARK: - Log Report - -// swiftlint:disable:next function_parameter_count -func report(_ text: String, - _ type: DM_LOG.Level, - _ localTime: DM_LOG.LocalTime, - _ owner: DM_LOG.PIDandTID, - _ user: DM_LOG.User, - _ dirs: DM_LOG.Directives) { +// MARK: - The log report - localReport.lastMessage = "[\(localTime.date)] [\(localTime.time)] \(text)" -} +func report(_ instance: PerseusDarkMode.LogMessage) { -// swiftlint:disable:next function_parameter_count -func report(_ text: String, - _ type: GEO_LOG.Level, - _ localTime: GEO_LOG.LocalTime, - _ owner: GEO_LOG.PIDandTID, - _ user: GEO_LOG.User, - _ dirs: GEO_LOG.Directives) { + let date = instance.localTime.date + let time = instance.localTime.time - localReport.lastMessage = "[\(localTime.date)] [\(localTime.time)] \(text)" + localReport.lastMessage = "[\(date)] [\(time)] \(instance.text)" } -let localReport = ConsolePerseusLogger.PerseusLogger.Report() - -// MARK: - Logger +func report(_ instance: PerseusGeoKit.LogMessage) { -GEO_LOG.customActionOnMessage = report(_:_:_:_:_:_:) -DM_LOG.customActionOnMessage = report(_:_:_:_:_:_:) + let date = instance.localTime.date + let time = instance.localTime.time -log.customActionOnMessage = localReport.report(_:_:_:_:_:_:) + localReport.lastMessage = "[\(date)] [\(time)] \(instance.text)" +} -// log.turned = .off -// dmlog.turned = .off -// geolog.turned = .off +let localReport = ConsolePerseusLogger.PerseusLogger.Report() -/* -var isLoadedInfo = "" +// MARK: - The logger -if let path = Bundle.main.url(forResource: "CPLConfig", withExtension: "json") { - if log.loadConfig(path), dmlog.loadConfig(path), geolog.loadConfig(path) { - isLoadedInfo = "Options successfully reseted!" - } else { - isLoadedInfo = "Failed to reset options!" - } -} else { - isLoadedInfo = "Failed to create URL!" -} +GEO_LOG.customActionOnMessage = report(_:) +DM_LOG.customActionOnMessage = report(_:) -log.message(isLoadedInfo) -*/ +log.customActionOnMessage = localReport.report(_:) log.message("The app's start point...", .info) -// MARK: - Run the app +// MARK: - The app run let globals = AppGlobals() diff --git a/DiscoveryProject/TheOneRing.xcodeproj/project.pbxproj b/DiscoveryProject/TheOneRing.xcodeproj/project.pbxproj index 59d552c..8876472 100644 --- a/DiscoveryProject/TheOneRing.xcodeproj/project.pbxproj +++ b/DiscoveryProject/TheOneRing.xcodeproj/project.pbxproj @@ -786,7 +786,7 @@ repositoryURL = "https://github.com/perseusrealdeal/PerseusDarkMode"; requirement = { kind = exactVersion; - version = 2.1.0; + version = 2.1.1; }; }; 2EE1B77C2DBE21E600375792 /* XCRemoteSwiftPackageReference "ConsolePerseusLogger" */ = { @@ -794,7 +794,7 @@ repositoryURL = "https://github.com/perseusrealdeal/ConsolePerseusLogger"; requirement = { kind = exactVersion; - version = 1.6.0; + version = 1.7.0; }; }; 2EE2C01A2EADEF1C000752AD /* XCRemoteSwiftPackageReference "PerseusGeoKit" */ = { @@ -802,7 +802,7 @@ repositoryURL = "https://github.com/perseusrealdeal/PerseusGeoKit"; requirement = { kind = exactVersion; - version = 1.1.0; + version = 1.1.1; }; }; /* End XCRemoteSwiftPackageReference section */ diff --git a/README.md b/README.md index 9d82639..a32b5ff 100644 --- a/README.md +++ b/README.md @@ -2,14 +2,14 @@ [![Actions Status](https://github.com/perseusrealdeal/theonering/actions/workflows/main.yml/badge.svg)](https://github.com/perseusrealdeal/theonering/actions/workflows/main.yml) [![Style](https://github.com/perseusrealdeal/theonering/actions/workflows/swiftlint.yml/badge.svg)](https://github.com/perseusrealdeal/theonering/actions/workflows/swiftlint.yml) -![Version](https://img.shields.io/badge/Version-2.2-green.svg) +![Version](https://img.shields.io/badge/Version-2.3-green.svg) [![Platforms](https://img.shields.io/badge/Platform-iOS%2012.4+-orange.svg)](https://en.wikipedia.org/wiki/IOS_12) [![Xcode](https://img.shields.io/badge/Xcode-14.2+-red.svg)](https://en.wikipedia.org/wiki/Xcode) [![Swift](https://img.shields.io/badge/Swift-5-orange.svg)](https://docs.swift.org/swift-book/RevisionHistory/RevisionHistory.html) [![SDK](https://img.shields.io/badge/SDK-UIKit%20-blueviolet.svg)](https://developer.apple.com/documentation/uikit) [![License](http://img.shields.io/:License-Unlicense-green.svg)](/LICENSE) -> The fan iOS app in the Middle-earth theme with screens from the motion picture `The Lord of The Rings` based on the novel by `J.R.R. Tolkien`. +> This is a great fan iOS app themed with the Middle-earth adventures from the motion picture `The Lord of The Rings` based on the novel by `J.R.R. Tolkien`. > For details: [`Approbation and A3 Environment`](/APPROBATION.md). @@ -17,9 +17,9 @@ > Swift Package Manager. -[![ConsolePerseusLogger](http://img.shields.io/:ConsolePerseusLogger-1.6.0-green.svg)](https://github.com/perseusrealdeal/ConsolePerseusLogger.git) -[![PerseusDarkMode](http://img.shields.io/:PerseusDarkMode-2.1.0-green.svg)](https://github.com/perseusrealdeal/PerseusDarkMode.git) -[![PerseusGeoKit](http://img.shields.io/:PerseusGeoKit-1.1.0-green.svg)](https://github.com/perseusrealdeal/PerseusGeoKit.git) +[![ConsolePerseusLogger](http://img.shields.io/:ConsolePerseusLogger-1.7.0-green.svg)](https://github.com/perseusrealdeal/ConsolePerseusLogger.git) +[![PerseusDarkMode](http://img.shields.io/:PerseusDarkMode-2.1.1-green.svg)](https://github.com/perseusrealdeal/PerseusDarkMode.git) +[![PerseusGeoKit](http://img.shields.io/:PerseusGeoKit-1.1.1-green.svg)](https://github.com/perseusrealdeal/PerseusGeoKit.git) ## Our Terms @@ -49,9 +49,9 @@ | Type | Name | License | | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------- | -| Package | [ConsolePerseusLogger](https://github.com/perseusrealdeal/ConsolePerseusLogger) / [1.6.0](https://github.com/perseusrealdeal/ConsolePerseusLogger/releases/tag/1.6.0) | MIT | -| Package | [PerseusDarkMode](https://github.com/perseusrealdeal/PerseusDarkMode) / [2.1.0](https://github.com/perseusrealdeal/PerseusDarkMode/releases/tag/2.1.0) | MIT | -| Package | [PerseusGeoKit](https://github.com/perseusrealdeal/PerseusGeoKit) / [1.1.0](https://github.com/perseusrealdeal/PerseusGeoKit/releases/tag/1.1.0) | MIT | +| Package | [ConsolePerseusLogger](https://github.com/perseusrealdeal/ConsolePerseusLogger) / [1.7.0](https://github.com/perseusrealdeal/ConsolePerseusLogger/releases/tag/1.7.0) | MIT | +| Package | [PerseusDarkMode](https://github.com/perseusrealdeal/PerseusDarkMode) / [2.1.1](https://github.com/perseusrealdeal/PerseusDarkMode/releases/tag/2.1.1) | MIT | +| Package | [PerseusGeoKit](https://github.com/perseusrealdeal/PerseusGeoKit) / [1.1.1](https://github.com/perseusrealdeal/PerseusGeoKit/releases/tag/1.1.1) | MIT | # Third-party software @@ -64,7 +64,7 @@ # Unlicensed Free Software -- [License](/LICENSE) +[`License doc`](/LICENSE) for details. ## Required License Notices @@ -104,4 +104,4 @@ # Prepared by -> © Mikhail A. Zhigulin of Novosibirsk +> © Mikhail A. Zhigulin of Novosibirsk.