Skip to content
This repository has been archived by the owner on Sep 26, 2023. It is now read-only.

Add logging #30

Merged
merged 2 commits into from
Apr 17, 2019
Merged

Add logging #30

merged 2 commits into from
Apr 17, 2019

Conversation

kittsville
Copy link
Contributor

Thought I'd keep it simple with the first logging PR. We can add other info/debugging stuff as and when needed:

  • Adds a logging library for proper management of log visibility
  • Can now enable web logs with an env param
  • Defaults to info level and only logs from gitkv itself
  • Logs listening port/IP and loaded repos

Example log:

Kit:gitkv Kit$ cargo run -- --repo-root=/Users/Kit/Projects
   Compiling gitkv v0.1.0 (/Users/Kit/Projects/sandbox/gitkv/server)
    Finished dev [unoptimized + debuginfo] target(s) in 9.16s
     Running `target/debug/gitkv --repo-root=/Users/Kit/Projects`
[2019-04-15T13:35:30Z INFO  gitkv] Loaded Git repos: [Recibase, gitkv, anon, business-cat]
[2019-04-15T13:35:30Z INFO  gitkv] Listening on localhost:7791

Copy link
Contributor

@nathankleyn nathankleyn left a comment

Choose a reason for hiding this comment

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

A suggestion on how to avoid some memory allocation and copying here by having a slightly different log and using std::fmt features! 👍

server/src/main.rs Outdated Show resolved Hide resolved
@nathankleyn nathankleyn self-assigned this Apr 16, 2019
@nathankleyn
Copy link
Contributor

Spoke to @kittsville on Slack quickly — just needs the unused import removed, then build will pass. LGTM! 👏

Copy link
Contributor

@nathankleyn nathankleyn left a comment

Choose a reason for hiding this comment

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

LGTM! 👍

@codecov-io
Copy link

Codecov Report

Merging #30 into master will increase coverage by 0.09%.
The diff coverage is 80%.

@@           Coverage Diff           @@
##           master   #30      +/-   ##
=======================================
+ Coverage    69.9%   70%   +0.09%     
=======================================
  Files           3     3              
  Lines         216   220       +4     
=======================================
+ Hits          151   154       +3     
- Misses         65    66       +1

@nathankleyn nathankleyn merged commit 364d822 into master Apr 17, 2019
@nathankleyn nathankleyn deleted the add-logging branch April 17, 2019 20:04
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants