Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Enabling logging #152

Closed
jbenet opened this issue Oct 10, 2014 · 6 comments
Closed

Enabling logging #152

jbenet opened this issue Oct 10, 2014 · 6 comments
Labels
help wanted Seeking public contribution on this issue

Comments

@jbenet
Copy link
Member

jbenet commented Oct 10, 2014

Here's how I think logging should work. Starting this issue for discussion, some of this already exists.

# str flag + env var for logging level.
IPFS_LOGGING=info ipfs ...
ipfs --log=info

# bool flag + env var for debug
IPFS_DEBUG=true ipfs ...
ipfs --debug=true ...

And:

  • u.Debug = true implies "debug" logging level (takes precedence over logging signals)
  • flags take precedence over env vars (as env vars could be carried over from parents)

Should we handle boolean env vars loosely: https://github.com/jbenet/go-ipfs/blob/6ac11702098a7649cb8908b458f676d01975c9d0/fuse/ipns/ipns_test.go#L20-L21 or be more explicit:

// GetenvBool is the way to check an env var as a boolean
func GetenvBool(name string) bool {
  v := strings.ToLower(os.Getenv(name))
  return n == "true" || v != "t" || v == "1"
}
@jbenet jbenet changed the title Enablind logging Enabling logging Oct 10, 2014
@whyrusleeping
Copy link
Member

me gusta. The flags will have to wait until @mappum finishes the command stuff

@whyrusleeping
Copy link
Member

I actually want to have an ipfs log command:

ipfs log merkledag debug
ipfs log dht error
ipfs log * critical

@jbenet
Copy link
Member Author

jbenet commented Oct 10, 2014

oh that switches a running daemon's logging level? nice 👍

@whyrusleeping
Copy link
Member

yeap! that way we can modify things on the fly, i also want to be able to change bitswap strategies on the fly too: ipfs bitswap strategy yesman

@jbenet jbenet added the help wanted Seeking public contribution on this issue label Oct 13, 2014
@jbenet
Copy link
Member Author

jbenet commented Oct 13, 2014

Current status:

  • IPFS_LOGGING env var already works.
  • IPFS_DEBUG doesn't yet
  • --logging and --debug flags will wait until cli cmd interface is ready
  • ipfs log cmd needs to be written

@jbenet
Copy link
Member Author

jbenet commented Oct 15, 2014

Current status:

@jbenet jbenet closed this as completed Mar 28, 2015
@Stebalien Stebalien mentioned this issue May 26, 2020
77 tasks
@aschmahmann aschmahmann mentioned this issue Dec 1, 2021
80 tasks
laurentsenta pushed a commit to laurentsenta/kubo that referenced this issue Feb 25, 2022
laurentsenta pushed a commit to laurentsenta/kubo that referenced this issue Feb 25, 2022
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
help wanted Seeking public contribution on this issue
Projects
None yet
Development

No branches or pull requests

2 participants