Skip to content

Commit 3d0c459

Browse files
CHANGED: default level for DEBUG build
1 parent 94dca62 commit 3d0c459

File tree

7 files changed

+33
-17
lines changed

7 files changed

+33
-17
lines changed

APPROBATION.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Approbation Matrix / ConsolePerseusLogger v1.0.1
1+
# Approbation Matrix / ConsolePerseusLogger v1.0.2
22

33
> Approbated feature: Logging to Console on Mac.<br/>
44

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
55

66
Dates in this file meets Gregorian calendar. Date in format YYYY-MM-DD.
77

8+
## [1.0.2] - [2024-10-17], Console Output
9+
10+
### Changed
11+
12+
- Default Message Level for DEBUG build from .notice to .debug.
13+
814
## [1.0.1] - [2024-10-16], Console Output
915

1016
### Fixed

Package.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// swift-tools-version:5.7
22

33
/* Package.swift
4-
Version: 1.0.1
4+
Version: 1.0.2
55

66
Created by Mikhail Zhigulin in 7533.
77

PerseusLoggerStar.swift

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//
22
// PerseusLoggerStar.swift
3-
// Version: 1.0.1
3+
// Version: 1.0.2
44
//
55
// PLATFORMS: macOS 10.12+ | iOS 10.0+
66
//
@@ -89,20 +89,23 @@ public class PerseusLogger {
8989

9090
case debug = 5
9191
case info = 4
92-
case notice = 3 // Default.
92+
case notice = 3
9393
case error = 2
9494
case fault = 1
9595
}
9696

9797
#if DEBUG
9898
public static var turned = Status.on
9999
public static var output = Output.xcodedebug
100+
101+
public static var level = Level.debug
100102
#else
101103
public static var turned = Status.off
102104
public static var output = Output.consoleapp
103-
#endif
104105

105106
public static var level = Level.notice
107+
#endif
108+
106109
public static var short = true
107110
public static var marks = true
108111

README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
55
[![Actions Status](https://github.com/perseusrealdeal/ConsolePerseusLogger/actions/workflows/main.yml/badge.svg)](https://github.com/perseusrealdeal/ConsolePerseusLogger/actions/workflows/main.yml)
66
[![Style](https://github.com/perseusrealdeal/ConsolePerseusLogger/actions/workflows/swiftlint.yml/badge.svg)](https://github.com/perseusrealdeal/ConsolePerseusLogger/actions/workflows/swiftlint.yml)
7-
[![Version](https://img.shields.io/badge/Version-1.0.1-green.svg)](/CHANGELOG.md)
7+
[![Version](https://img.shields.io/badge/Version-1.0.2-green.svg)](/CHANGELOG.md)
88
[![Platforms](https://img.shields.io/badge/Platforms-macOS%2010.13+_|_iOS%2011.0+-orange.svg)](https://en.wikipedia.org/wiki/List_of_Apple_products)
99
[![Xcode 14.2](https://img.shields.io/badge/Xcode-14.2+-red.svg)](https://en.wikipedia.org/wiki/Xcode)
1010
[![Swift 5.7](https://img.shields.io/badge/Swift-5.7-red.svg)](https://www.swift.org)
@@ -33,13 +33,13 @@ log.message("[\(type(of: self))].\(#function)")
3333

3434
```
3535

36-
| Level | Message | Default Message | Default Level | Purpose |
37-
| :---: | :------ | :-------------: | :-----------: | :------------------------------------ |
38-
| 5 | DEBUG | Default | | Debugging only |
39-
| 4 | INFO | | | Helpful, but not essential |
40-
| 3 | NOTICE | | Default | Might result in a failure |
41-
| 2 | ERROR | | | Errors seen during the code execution |
42-
| 1 | FAULT | | | Faults and bugs in the code |
36+
| Level | Message Type | Purpose |
37+
| :---: | :----------- | :------------------------------------ |
38+
| 5 | DEBUG | Debugging only |
39+
| 4 | INFO | Helpful, but not essential |
40+
| 3 | NOTICE | Might result in a failure |
41+
| 2 | ERROR | Errors seen during the code execution |
42+
| 1 | FAULT | Faults and bugs in the code |
4343

4444
# Manual
4545
## Setting the Logger for Work
@@ -50,7 +50,7 @@ log.message("[\(type(of: self))].\(#function)")
5050
| :---------- | :--------------: | :----------------: | :----------------------------------------------------- |
5151
| tuned | .on | .off | If .off no matter what level no message will be passed |
5252
| output | .xcodedebug | .consoleapp | Message output target |
53-
| level | .notice | .notice | No any messages on any level above |
53+
| level | .debug | .notice | No any messages on any level above |
5454
| short | true | true | FALSE: Message goes with file name and line number |
5555
| marks | true | true | FALSE: Message text, TRUE: [LOG] [DEBUG] Message text |
5656
| logObject | nil | nil | Mac Console Subsystem and Category values group |

Sources/ConsolePerseusLogger/PerseusLogger.swift

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,20 +58,23 @@ public class PerseusLogger {
5858

5959
case debug = 5
6060
case info = 4
61-
case notice = 3 // Default.
61+
case notice = 3
6262
case error = 2
6363
case fault = 1
6464
}
6565

6666
#if DEBUG
6767
public static var turned = Status.on
6868
public static var output = Output.xcodedebug
69+
70+
public static var level = Level.debug
6971
#else
7072
public static var turned = Status.off
7173
public static var output = Output.consoleapp
72-
#endif
7374

7475
public static var level = Level.notice
76+
#endif
77+
7578
public static var short = true
7679
public static var marks = true
7780

Tests/UnitTests/FunctionalTests.swift

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@ final class FunctionalTests: XCTestCase {
3131
func test_is_output_xcodedebug() {
3232
XCTAssertEqual(log.output, .xcodedebug)
3333
}
34+
35+
func test_is_level_notice() {
36+
XCTAssertEqual(log.level, .debug)
37+
}
3438
#else
3539
func test_is_status_off() {
3640
XCTAssertEqual(log.turned, .off)
@@ -39,11 +43,11 @@ final class FunctionalTests: XCTestCase {
3943
func test_is_output_consoleapp() {
4044
XCTAssertEqual(log.output, .consoleapp)
4145
}
42-
#endif
4346

4447
func test_is_level_notice() {
4548
XCTAssertEqual(log.level, .notice)
4649
}
50+
#endif
4751

4852
func test_is_message_short() {
4953
XCTAssertTrue(log.short)

0 commit comments

Comments
 (0)