daroczig / daroczig/logger

About function names

Open
#195 2 comments 2 reactions 0 assignees View on GitHub
help wanted
Dominant language
HTML
Stars
323
Forks
46
Avg merge
1d 21h
Merged PRs (30d)
1

Description

What always confuses me: there are functions beginning with "log" that don't cause a logging action, but somehow change the logging behaviour.

Functions that actually log:
```
- log_level()
- log_fatal()
- log_error()
- log_warn()
- log_success()
- log_info()
- log_debug()
- log_trace()
- log_eval()
- log_failure()
- log_tictoc()
- log_separator()
- log_with_separator()
```
Functions that don't log, but change logger's behaviour:
```
- log_threshold()
- log_appender()
- log_formatter()
- log_layout()
- log_messages()
- log_warnings()
- log_errors()
- logger()
- delete_logger_index()
```
Helpers:
```
- with_log_threshold()
- log_shiny_input_changes()
- get_logger_meta_variables()
- log_namespaces()
- log_indices()
- ...
```
I know it's a bit late to change anything and breaks the API, but out of curiosity: Wouldn't the function names be more understandable if those that change logging behaviour would be prefixed with "logger_"? So
```
- logger()
- logger_threshold()
- logger_appender()
- logger_formatter()
- logger_layout()
- logger_messages()
- logger_warnings()
- logger_errors()
- logger_delete_index()
- logger_get_meta_variables()
- logger_get_namespaces()
- logger_get_indices()
```
Or is it just me?

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reviewing the listed logging functions and helpers in the issue, separating functions that emit messages from those that change logger behavior. Check the existing API and comment history before proposing any naming change; done would require an agreed, compatibility-aware scope for the public function names.

Written by the indexing model from the issue text.

Assessment

Tech stack
r
Domain
tooling
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.