rust-simple_logger VS gophers

Compare rust-simple_logger vs gophers and see what are their differences.

rust-simple_logger

A rust logger that prints all messages with a readable output format. (by borntyping)

gophers

Gopher artwork (Golang mascot) (by scraly)
InfluxDB - Power Real-Time Data Analytics at Scale
Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
www.influxdata.com
featured
SaaSHub - Software Alternatives and Reviews
SaaSHub helps you find the best software and product alternatives
www.saashub.com
featured
rust-simple_logger gophers
1 4
217 30
- -
6.7 3.7
4 months ago about 1 month ago
Rust
MIT License GNU General Public License v3.0 or later
The number of mentions indicates the total number of mentions that we've tracked plus the number of user suggested alternatives.
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.

rust-simple_logger

Posts with mentions or reviews of rust-simple_logger. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2021-09-13.
  • Rust cli example #2: Ferris hunts errors
    3 projects | dev.to | 13 Sep 2021
    As a backend facility, we will use the simple_logger crate. This crate will simply output messages formatted like this 2015-02-24 01:05:20 WARN [logging_example] This is an example message. I like the crate because it is simple to use and a good fit for small projects. Also, I contributed to another project (rust-riemann-client) maintained by the same author @borntyping (hello Sam) and, it was really an excellent experience. Sources

gophers

Posts with mentions or reviews of gophers. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2021-09-13.
  • Rust cli example #2: Ferris hunts errors
    3 projects | dev.to | 13 Sep 2021
    fn get_gopher(gopher: String) -> Result { println!("Try to get {} Gopher...", gopher); let url = format!("https://github.com/scraly/gophers/raw/main/{}.png", gopher); let response = minreq::get(url) .send() .expect("Fail to get response from server"); if response.status_code == 200 { let file_name = format!("{}.png", gopher); let mut output_file = File::create(&file_name).expect("Fail to create file"); output_file .write_all(response.as_bytes()) .expect("Fail to write file"); Ok(format!("Perfect! Just saved in {}", &file_name)) } else { Err(Error::GopherNotFound(format!( "Gopher {} not exists", gopher ))) } }
  • Rust cli example: Ferris fetches Go gopher postcards
    3 projects | dev.to | 9 Aug 2021
    use std::fs::File; use std::io::stdout; use std::io::Write; use structopt::clap::{crate_name, crate_version, Shell}; use structopt::StructOpt; #[derive(StructOpt, Debug)] #[structopt(name = "rust-gopher-friend-cli", version = crate_version!(), about = "Gopher CLI application written in Rust.")] enum Command { /// This command will get the desired Gopher Get { /// Gopher type #[structopt()] gopher: String, }, /// Generate completion script Completion { /// Shell type #[structopt(possible_values = &["bash", "fish", "zsh", "powershell", "elvish"])] shell: Shell, }, } fn get_gopher(gopher: String) { println!("Try to get {} Gopher...", gopher); let url = format!("https://github.com/scraly/gophers/raw/main/{}.png", gopher); let response = minreq::get(url) .send() .expect("Fail to get response from server"); if response.status_code == 200 { let file_name = format!("{}.png", gopher); let mut output_file = File::create(&file_name).expect("Fail to create file"); output_file .write_all(response.as_bytes()) .expect("Fail to write file"); println!("Perfect! Just saved in {}", &file_name); } else { eprintln!("Gopher {} not exists", gopher); } } fn main() { let cmd = Command::from_args(); match cmd { Command::Get { gopher } => get_gopher(gopher), Command::Completion { shell } => { Command::clap().gen_completions_to(crate_name!(), shell, &mut stdout()) } } }
  • Learning Go by examples: part 3 - Create a CLI app in Go
    3 projects | dev.to | 27 Jul 2021
    var getCmd = &cobra.Command{ Use: "get", Short: "This command will get the desired Gopher", Long: `This get command will call GitHub respository in order to return the desired Gopher.`, Run: func(cmd *cobra.Command, args []string) { var gopherName = "dr-who.png" if len(args) >= 1 && args[0] != "" { gopherName = args[0] } URL := "https://github.com/scraly/gophers/raw/main/" + gopherName + ".png" fmt.Println("Try to get '" + gopherName + "' Gopher...") // Get the data response, err := http.Get(URL) if err != nil { fmt.Println(err) } defer response.Body.Close() if response.StatusCode == 200 { // Create the file out, err := os.Create(gopherName + ".png") if err != nil { fmt.Println(err) } defer out.Close() // Writer the body to file _, err = io.Copy(out, response.Body) if err != nil { fmt.Println(err) } fmt.Println("Perfect! Just saved in " + out.Name() + "!") } else { fmt.Println("Error: " + gopherName + " not exists! :-(") } }, }
  • Learning Go by examples: part 2 - Create an HTTP REST API Server in Go
    6 projects | dev.to | 20 Jul 2021
    package main import ( "fmt" "log" "net/http" "github.com/go-openapi/loads" "github.com/go-openapi/runtime/middleware" "github.com/scraly/learning-go-by-examples/go-rest-api/pkg/swagger/server/restapi" "github.com/scraly/learning-go-by-examples/go-rest-api/pkg/swagger/server/restapi/operations" ) func main() { // Initialize Swagger swaggerSpec, err := loads.Analyzed(restapi.SwaggerJSON, "") if err != nil { log.Fatalln(err) } api := operations.NewHelloAPIAPI(swaggerSpec) server := restapi.NewServer(api) defer func() { if err := server.Shutdown(); err != nil { // error handle log.Fatalln(err) } }() server.Port = 8080 api.CheckHealthHandler = operations.CheckHealthHandlerFunc(Health) api.GetHelloUserHandler = operations.GetHelloUserHandlerFunc(GetHelloUser) api.GetGopherNameHandler = operations.GetGopherNameHandlerFunc(GetGopherByName) // Start server which listening if err := server.Serve(); err != nil { log.Fatalln(err) } } //Health route returns OK func Health(operations.CheckHealthParams) middleware.Responder { return operations.NewCheckHealthOK().WithPayload("OK") } //GetHelloUser returns Hello + your name func GetHelloUser(user operations.GetHelloUserParams) middleware.Responder { return operations.NewGetHelloUserOK().WithPayload("Hello " + user.User + "!") } //GetGopherByName returns a gopher in png func GetGopherByName(gopher operations.GetGopherNameParams) middleware.Responder { var URL string if gopher.Name != "" { URL = "https://github.com/scraly/gophers/raw/main/" + gopher.Name + ".png" } else { //by default we return dr who gopher URL = "https://github.com/scraly/gophers/raw/main/dr-who.png" } response, err := http.Get(URL) if err != nil { fmt.Println("error") } return operations.NewGetGopherNameOK().WithPayload(response.Body) }

What are some alternatives?

When comparing rust-simple_logger and gophers you can also consider the following projects:

log - Logging implementation for Rust