Clarity

1.1.4

Clarity is a logging framework that prints log data referenced from JSON to the console using semantic formatting.
real-intelligence/Clarity

What's New

v1.1.4

2022-06-29T14:52:30Z

Bumped the swift-tools-version to 5.6 to allow building of the DocC catalogue containing articles and tutorials.

Full Changelog: v1.1.3...v1.1.4

SwiftSupported Platforms: iOS, macOS, tvOS, watchOSLicense: MITPayPalDocC

Clarity is a logging framework that prints log data referenced from JSON by number and displays the output in the console using semantic formatting.

Source code

//Clarity print statements in source code
print(1, functionName: #function)
print(2)
print(3, values: [ 1,2,3])

Console output

MYCLASS  πŸ“f   52    myFunction()
MYCLASS        52    N-2    βœ…  - An event occurred that is described here
                                  Effect: 'this' will happen next
MYCLASS        52    N-3    πŸ“‹  - Values for variable are:
                                  1
																	2
																	3																	

Overview

Clarity assumes three main β€˜nodes’ of developer interest in an application control flow: function call points, the resolution of conditional statements and the reporting of specific values including errors. Clarity print statements are designed to be placed at such node points in the client application source code.

All message data relating to each print statement is placed entirely in associated JSON files referenced by a unique number. This enables the printing of an unlimited amount of information to the console with negligible impact on the source code.

The customisable formatting of console log output is designed to emphasise nodes of interest in a clear narrative of the control flow. The output includes symbols that relate to the functionality and purpose of the code such that it is human readable and understandable at first sight.

Customisable filter settings enable the printing of specific isolated elements and referenced data.

The minimal API consists of two overload analogues of the Swift print(_:separator:terminator:) function – these functions: [print(_:functionName:settings:)](https://realint.org/documentation/clarity/print(_:functionname:settings:) and [print(_:values:settings:)](https://realint.org/documentation/clarity/print(_:values:settings:) reference associated JSON data via an index.

New to Release 2 are two functions for use when working with Combine publishers: [print(_:valuesForPublisherType:settings:)](https://realint.org/documentation/clarity/print(_:valuesforpublishertype:settings:) and an extension overload of print(_:to:).

Documentation

Clarity is fully documented in a DocC catalogue that includes articles, public API reference and tutorials.

The non public API is 100% documented using Jazzy.

Installing

Clarity is best installed as a Swift Package.

paypal

License

Clarity is released under the MIT license. See LICENSE for details.

Copyright (c) 2021-2022 Lawrence Heyfron https://realint.org/

Description

  • Swift Tools 5.6.0
View More Packages from this Author

Dependencies

  • None
Last updated: Sat Mar 16 2024 07:08:43 GMT-0900 (Hawaii-Aleutian Daylight Time)