jbenet/go-ipfs — pull request #380 by maybebtc (2014-11-24 01:20:11+00:00)
Title: fix(eventlog) initialization

This PR fixes two issues.

**daemon --init breaks eventlog configuration**

Introducing daemon --init broke eventlog configuration. Here's why:

1) Now, users may run daemon without an initialized repo.
2) the configureLogger hook checks to see whether the command usesConfig and usesRepo. If both are true, the logger is configured to use the IPFS_DIR. This is necessary since the logger logs to a file.

Since the daemon doesn't require a repo/config and configureLogger only runs if the upcoming command uses the config/repo, logs are not configured before running the daemon.

Notice that the one actual requirement for the hook is the existence of a config/repo.

Therefore, we may want to simply check this property directly. Thoughts?

**runtime logging system is not configured upon initialization**

Now, after initialization, we apply the config.Log settings to the logging system. This ensures logging works when the daemon is started using `daemon --init`

--

Third, this paves the way for the `repo` package described in #376.