Skip to content
Merged

v2.3 #21

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions DiscoveryProject/DarkModeDiscovery/AppGlobals.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
61 changes: 19 additions & 42 deletions DiscoveryProject/DarkModeDiscovery/main.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down
6 changes: 3 additions & 3 deletions DiscoveryProject/TheOneRing.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -786,23 +786,23 @@
repositoryURL = "https://github.com/perseusrealdeal/PerseusDarkMode";
requirement = {
kind = exactVersion;
version = 2.1.0;
version = 2.1.1;
};
};
2EE1B77C2DBE21E600375792 /* XCRemoteSwiftPackageReference "ConsolePerseusLogger" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/perseusrealdeal/ConsolePerseusLogger";
requirement = {
kind = exactVersion;
version = 1.6.0;
version = 1.7.0;
};
};
2EE2C01A2EADEF1C000752AD /* XCRemoteSwiftPackageReference "PerseusGeoKit" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/perseusrealdeal/PerseusGeoKit";
requirement = {
kind = exactVersion;
version = 1.1.0;
version = 1.1.1;
};
};
/* End XCRemoteSwiftPackageReference section */
Expand Down
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,24 @@

[![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).

## Dependencies

> 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

Expand Down Expand Up @@ -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

Expand All @@ -64,7 +64,7 @@

# Unlicensed Free Software

- [License](/LICENSE)
[`License doc`](/LICENSE) for details.

## Required License Notices

Expand Down Expand Up @@ -104,4 +104,4 @@

# Prepared by

> © Mikhail A. Zhigulin of Novosibirsk
> © Mikhail A. Zhigulin of Novosibirsk.