Skip to content

[Stale] [Telemetry] Introduce a singleton std logger to the codebase to unify logs#162

Closed
derrandz wants to merge 3 commits intomainfrom
telemetry/logging
Closed

[Stale] [Telemetry] Introduce a singleton std logger to the codebase to unify logs#162
derrandz wants to merge 3 commits intomainfrom
telemetry/logging

Conversation

@derrandz
Copy link
Copy Markdown
Contributor

@derrandz derrandz commented Aug 9, 2022

Description

In order to achieve the goals of logging for the telemetry milestone, we will unify logging across the codebase by using a singleton logger. This logger will be imported directly in the shared scope of modules, but will also be used in the modules' scope through the telemetry module.

The origin document can be found here: #164

Changes

  • Introduced the Logger interface under shared/logging
  • Implemented the Logger interface while using log.Logger as the log engine and os.Stdout as the output.
  • Added support for multiple log levels and a method for each level with tests

The log line format is as follows:

YYYY/DD/MM HH:MM:SS | [PREFIX] [LEVEL] : [NAMESPACE] LOG_LINE....

Example:

2022/01/08 08:29:20 | [POCKET] [INFO] : [CONSENSUS] Successfully proposed a block

Please lookup the available levels and namespaces in shared/logging/types.go

Owners

@derrandz

@derrandz derrandz force-pushed the telemetry/logging branch from 71156f7 to 680ef51 Compare August 9, 2022 12:12
@derrandz derrandz added telemetry everything related to collection telemetry tooling tooling to support development, testing et al labels Aug 10, 2022
@derrandz derrandz added this to the V1 Telemetry milestone Aug 10, 2022
@Olshansk Olshansk changed the title [Telemetry]: Introduce a singleton std logger to the codebase to unify logs [WIP][Telemetry]: Introduce a singleton std logger to the codebase to unify logs Aug 22, 2022
@Olshansk Olshansk changed the title [WIP][Telemetry]: Introduce a singleton std logger to the codebase to unify logs [WIP] [Telemetry]: Introduce a singleton std logger to the codebase to unify logs Aug 22, 2022
@Olshansk Olshansk changed the title [WIP] [Telemetry]: Introduce a singleton std logger to the codebase to unify logs [Stale] [Telemetry]: Introduce a singleton std logger to the codebase to unify logs Sep 3, 2022
@Olshansk Olshansk changed the title [Stale] [Telemetry]: Introduce a singleton std logger to the codebase to unify logs [Stale] [Telemetry] Introduce a singleton std logger to the codebase to unify logs Sep 3, 2022
@Olshansk
Copy link
Copy Markdown
Collaborator

Going to close this out since we are unlikely to iterate on top of this PR specifically but planning on using it as a reference for when we standardize logging.

@Olshansk Olshansk closed this Sep 27, 2022
@Olshansk Olshansk deleted the telemetry/logging branch June 2, 2023 21:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

telemetry everything related to collection telemetry tooling tooling to support development, testing et al

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants