42wim / matterircd

Connect to your mattermost or slack using your IRC-client of choice.
MIT License
295 stars 60 forks source link

Add config file option. #134

Closed slowbro closed 6 years ago

slowbro commented 6 years ago

For 42wim/matterircd#63

42wim commented 6 years ago

Thanks! Looks good, but I'm wondering why you changed logger to Logger in main.go ?

slowbro commented 6 years ago

Ah yes... I supposed that was needed to access to logger from the config package but then ended up just setting it in main().. I can change that back tonight :)

On Nov 26, 2017 2:24 PM, "Wim" notifications@github.com wrote:

Thanks! Looks good, but I'm wondering why you changed logger to Logger in main.go ?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/42wim/matterircd/pull/134#issuecomment-347043581, or mute the thread https://github.com/notifications/unsubscribe-auth/AAT9fUE-SvztsJWfGgHsaCy7jQS9jOVoks5s6eUQgaJpZM4QoHpk .

42wim commented 6 years ago

Yes please:) The rest is fine and can be merged!

slowbro commented 6 years ago

There we go. I rebased it all into one commit, too, and also added a Logger.Infof in config to output the config loaded info:

$ ./matterircd -config matterircd.toml INFO[2017-11-27T10:11:23-08:00] Loaded config from matterircd.toml module=matterircd INFO[2017-11-27T10:11:23-08:00] Running version 0.15.0 module=matterircd INFO[2017-11-27T10:11:23-08:00] Listening on 127.0.0.1:6666 module=matterircd

slowbro commented 6 years ago

Sorry, one last try! I had accidentally removed the // backwards compatible section. re-added.

slowbro commented 6 years ago

Found a bug.. not ready for merge. cfg doesn't seem to be available in the go func() subsections. Investigating.

42wim commented 6 years ago

Ok, I'll wait, don't have time to help you at the moment though :(

slowbro commented 6 years ago

No worries. I actually fixed it in 979ae99... I was re-initializing cfg (:=) instead of just using it since it was defined in vars. :)

42wim commented 6 years ago

Thanks a lot!