Code Monkey home page Code Monkey logo

Comments (6)

mikejac avatar mikejac commented on June 24, 2024

Hi,

Dave Cheney has some interesting ideas: http://dave.cheney.net/2015/11/05/lets-talk-about-logging

Kinda like it :-)

/michael

from hc.

sgrimee avatar sgrimee commented on June 24, 2024

regardless of how logging is done, is there a way to suppress VERB when using hc ?

I have tried importing brutella/logs and setting log.Verbose = false in my project but I am still getting the VERB output, which makes it difficult to locate my own debugs?

from hc.

brutella avatar brutella commented on June 24, 2024

@sgrimee This should work

from hc.

sgrimee avatar sgrimee commented on June 24, 2024

@brutella thanks but this does not work for me, if I take your example above and set log.Verbose and log.Info to false I still see both debug levels:

~/go/src/github.com/brutella/hklight (master ✘)✹✭ ᐅ grep -e 'log..*=' hklightd.go
    log.Verbose = false
    log.Info = false
~/go/src/github.com/brutella/hklight (master ✘)✹✭ ᐅ go run hklightd.go
2016/10/02 11:02:29 [INFO] Accessory IP is 10.0.1.200
2016/10/02 11:02:38 [VERB] 10.0.1.240:61606 POST /pair-setup
2016/10/02 11:02:38 [VERB] Create new pair setup controller
2016/10/02 11:02:38 [VERB] <-     B: 333db84bbe506c243df07e28

from hc.

brutella avatar brutella commented on June 24, 2024

There are now 2 log levels: info and debug.

Info messages are messages for the user. Debug messages are messages for the developer.
By default the debug log level is disabled, which means that those logs are written to /dev/null.

You can enable the debug log level like this:

import "github.com/brutella/hc/log"

log.Debug.Enable()

from hc.

sgrimee avatar sgrimee commented on June 24, 2024

This works great, thank you Matthias!

from hc.

Related Issues (20)

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.