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

Introduce cider-log-show function #3602

Merged
merged 9 commits into from
Jan 2, 2024
Merged

Introduce cider-log-show function #3602

merged 9 commits into from
Jan 2, 2024

Conversation

vemv
Copy link
Member

@vemv vemv commented Jan 1, 2024

Rehash of #3592, with misc feedback applied.

My take is summarized in the expanded documentation - there are three approaches, two of which are higher-level and therefore most recommended as an entrypoint to most users.

My thinking is that of the high-level commands, one (cider-log-show) would never use transient-mode, and the other one (cider-log-event) always would. This way we have predictable UXs for users.

Commits:

  • Introduce cider-log-show function
  • Prefer logview-mode unconditionally, and warn when it's absent
    • This way, users will know that logview-mode exists.
    • There's still fallback, and optionality.

Happy new year,

-V

@vemv vemv requested review from r0man and bbatsov January 1, 2024 11:20
@vemv vemv mentioned this pull request Jan 1, 2024
@vemv vemv changed the title Introduce cider-log-show function Introduce cider-log-show function Jan 1, 2024
Copy link
Contributor

@r0man r0man left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks for improving this @vemv !

cider-log.el Outdated
@@ -1154,12 +1178,17 @@ the CIDER Inspector and the CIDER stacktrace mode.
(let ((inhibit-read-only t))
(erase-buffer)))))

(defun cider-log-switch-to-buffer* (buffer)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we make this private, e.g. use 2 dashes cider-log--switch-to-buffer ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, probably. In general the external API for cider-log should be quite limited.

@@ -103,6 +145,15 @@ https://stackoverflow.com/a/17842174/12711900[difficulties] with
configuration changes made at runtime, which are wiped out by the
Log4j2 reconfiguration mechanism.

Timbre support is WIP as well.

TIP: If your logging framework of choice is not currently supported by CIDER Log Mode,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@bbatsov
Copy link
Member

bbatsov commented Jan 2, 2024

The changes look good to me overall.

session attached to it. The first time you run the command, it will
To use CIDER Log Mode, there are a few ways to get started:

* Traditionally, `M-x cider-log` has been considered the main entrypoint, although it can be slightly low-level for casual usage.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a brand new feature, so I don't think we can talk about "traditional" usage. :-) Let's just focus on the use-cases for each and not on whether something is newer/older.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was also thinking this, it's still marked as experimental in the docs.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As it should be. I don't want to mark it as stable until we've solidified the interface and I want us to have some leeway for breaking changes to get to the optimal interface.

@bbatsov
Copy link
Member

bbatsov commented Jan 2, 2024

My only bigger feedback is that even after reading the docs and knowing what the functions do, I find the differences between cider-log, cider-log-event and cider-log-show unclear.

You have to understand that most users will have 0 idea what transient-mode is, so you should not focus too much on implementation details, but rather on use-cases for the 3 commands.

@vemv
Copy link
Member Author

vemv commented Jan 2, 2024

Thanks folks, all feedback applied.

Now there are two documented ways to get started, and one function left as advanced usage in another section.

All ideas certainly welcome as for how to further improve workflows.

Will be deploying docs in a few minutes.

@vemv vemv merged commit ee7bdbd into master Jan 2, 2024
34 of 35 checks passed
@vemv vemv deleted the cider-log-show branch January 2, 2024 18:18
@vemv
Copy link
Member Author

vemv commented Jan 2, 2024

@r0man
Copy link
Contributor

r0man commented Jan 2, 2024

Nice! Thanks @vemv!

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.

3 participants