Coder Social home page Coder Social logo

femme's Introduction

hey hey!

I am lrlna, a Rust engineer working on a graphql compiler @apollographql. You can find me online on Mastodon. I also make zines, most of which I upload to smol-zines repo here.

femme's People

Contributors

elpiel avatar fishrock123 avatar goto-bus-stop avatar ikelutra avatar ineiti avatar jbr avatar lrlna avatar simao avatar yoshuawuyts avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

femme's Issues

Use cfg-if 1.0

rust-lang/cfg-if#31
cfg-if has had a 1.0.0 release with no breaking updates. Femme should be able to update to that version with a patch update. It is always nice to not need multiple versions of the same crate in one's dependency tree, which currently is required for dependents of femme that also require cfg-if 1.0.0.

add CI

^ to make sure we don't break upstream dependencies like tide and async-std. Plus it's just nice to have CI.

Fix JSON encoding

Once rust-lang/log#400 lands our JSON encoding will be broken since string values will no longer be printed as "...". This is a bug fix for log, but we were working around it for our JSON encoding. We should update our JSON encoding once that lands and publish a patch release. Thanks!

Trim down interface

I've been using femme for a while now, and initializing it always requires copying over some boilerplate. I wish we could streamline this slightly:

femme::info()?; // start femme with info log level
femme::trace()?; // start femme with trace level

In addition to that, something that env-logger does well is provide a way to filter messages. In reality these methods should be be a constructor for a Logger struct that can be further configured.

This would also allow us to trim down the submodules we have. When piping we should always print out ndjson. When printing to stdout we should use the pretty printer.

The "simple" printer becomes a bit of a strange one, but perhaps we don't need it per-se? I'm unsure really. Thoughts would be welcome here. Thanks!

unusual "level" output in ndjson

I think the numerical output is similar to some Node.js logger, if I recall?

I think bole.js outputs as e.g. "level": "info", though. json_env_logger also outputs as text (though, unfortunately as caps, which is also weird.).

An option may be nice, or a build feature.

String output is printed with extra quotes

http-rs/tide#495 (comment) shows that command line output is printed with extra quotes. We should fix this.

{"level":30,"time":1589717147052,"msg":"--> Response sent","method":"\"GET\"","status":"200","duration":"\"157ms\"","path":"\"/api/v1/users\""}

I believe #10 makes some progress towards this by removing the intermediate strings. But we should still do better. And add tests to ensure we catch this. Thanks!

Key value formatting

Current released version of femme lacks quoting around extra kv pairs, I see the it got solved after a recent-ish PR(needs to be released) but I was wondering if writing those kv pairs could be smarter, if I have a string-like value then be quoted but a number-like value for example remain unquoted. Is it something that maybe serde_json that is already used could solve?

Filter messages from modules

Femme looks quite nice, one feature I'm missing though is to filter out debug messages from some dependencies, I still want to keep the debug level but not log things from hyper for example.

add config to choose pretty/ndjson

pub fn with_level(level: log::LevelFilter) {
    #[cfg(target_arch = "wasm32")]
    wasm::start(level);

    #[cfg(not(target_arch = "wasm32"))]
    {
        // Use ndjson in release mode, pretty logging while debugging.
       // here add some cfg! to choose pretty/ndjson
        if cfg!(debug_assertions) {
            pretty::start(level);
        } else {
            ndjson::start(level);
        }
    }
}

License files missing

Unfortunately your project is missing the LICENSE-MIT and LICENSE-APACHE files, which are referenced by the readme. Could you please add them? ๐Ÿ™‚

IANAL but I believe such files are actually necessary for a project to be considered open-source. ๐Ÿค”

Thank you in advance!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.