Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add pretty print methods to help debug #14

Merged
merged 3 commits into from
May 31, 2024

Conversation

mannylopez
Copy link
Owner

Add pretty print methods to help debug

/// Pretty prints a Moon object, useful for debugging
/// Example:
/// ```swift
/// let date = TestHelper.formatDate(year: 2024, month: 06, day: 7)
/// let moon = TinyMoon.Moon(date: date)
/// TestHelper.prettyPrintMoonObject(moon)
/// ```
/// Returns
/// ```
/// ...
/// 2024-06-07 07:00:00 +0000
///     🌑 newMoon
///     - lunarDay: 0.7625128604803247
///     - maxLunarDay: 28.762512860479735
///     - daysTillFullMoon: 14
///     - daysTillNewMoon: 0
/// ```
static func prettyPrintMoonObject(_ moon: TinyMoon.Moon) {...}

/// Prints the 4 major phases for each month in a given year
/// Example output for 2024
/// ```
/// // January
/// 🌗 2024-01-03 08:00:00 +0000 lastQuarter
/// 🌑 2024-01-11 08:00:00 +0000 newMoon
/// 🌓 2024-01-17 08:00:00 +0000 firstQuarter
/// 🌕 2024-01-25 08:00:00 +0000 fullMoon
/// ...
/// // December
/// 🌑 2024-12-01 08:00:00 +0000 newMoon
/// 🌓 2024-12-07 08:00:00 +0000 firstQuarter
/// 🌗 2024-12-22 08:00:00 +0000 lastQuarter
/// 🌑 2024-12-30 08:00:00 +0000 newMoon
/// ```
static func prettyPrintMoonPhasesForYear(_ year: Int) {...}

/// Prints a calendar view for each month in a given year
/// Example output for 2024
/// ```
/// january 2024
/// S    M     T      W     T     F     S
///       01🌖 |02🌖 | *🌗 |04🌘 |05🌘 |06🌘 |
/// 07🌘 |08🌘 |09🌘 |10🌘 | *🌑 |12🌒 |13🌒 |
/// 14🌒 |15🌒 |16🌒 | *🌓 |18🌔 |19🌔 |20🌔 |
/// 21🌔 |22🌔 |23🌔 |24🌔 | *🌕 |26🌖 |27🌖 |
/// 28🌖 |29🌖 |30🌖 |31🌖 |
/// ...
/// december 2024
/// S    M     T      W     T     F     S
/// *🌑 |02🌒 |03🌒 |04🌒 |05🌒 |06🌒 | *🌓 |
/// 08🌔 |09🌔 |10🌔 |11🌔 |12🌔 |13🌔 |14🌔 |
/// *🌕 |16🌖 |17🌖 |18🌖 |19🌖 |20🌖 |21🌖 |
/// *🌗 |23🌘 |24🌘 |25🌘 |26🌘 |27🌘 |28🌘 |
/// 29🌘 | *🌑 |31🌒 |
/// ```
static func prettyPrintCalendarForYear(_ year: Int) {...}

@mannylopez mannylopez merged commit 168b275 into main May 31, 2024
@mannylopez mannylopez deleted the debugging-prettyprint-helpers branch May 31, 2024 22:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant