Alex Bramley
12eb9c89eb
Simple adapter to utilise GLog with goirc.
2013-09-27 22:34:07 +01:00
Alex Bramley
5bb0c8278d
Minimally invasive change to put logging behind a user-replaceable interface.
...
This could probably be done better, and there are probably awful caveats
and hidden gotchas with this approach. I REGRET NOTHING.
2013-09-27 22:19:40 +01:00
Alex Bramley
4e4c4b6798
Migrate to split logging pkg.
2011-11-13 14:02:12 +00:00
Alex Bramley
aa12177399
My mock is clunky for external use, but works well for internal testing. Switch to gomock.
2011-11-05 09:27:44 +00:00
Alex Bramley
588a3168ac
More logging yak-shaving:
...
* Change Mock API to match mockNetConn Expect* calls.
* Make logging.NewMock take and store *testing.T.
* Add a level-agnostic Expect().
* Make writerMap an externally accessible type.
* Adjust tests to take this shaving into account.
2011-11-05 05:56:45 +00:00
Alex Bramley
049942ff2f
Hmm, using a fixed-length filename doesn't work when you're allowing other people to use your mocks.
2011-10-27 18:37:55 +01:00
Alex Bramley
97783df463
Make mock loggers log everything to avoid stupids.
2011-10-27 18:28:43 +01:00
Alex Bramley
2f5d4d86a5
Really sort out indentation.
2011-10-27 18:07:56 +01:00
Alex Bramley
74ef93abde
Fix behaviour of CheckWrittenAtLevel() slightly:
...
1) Adjust alignments for exp/got correctly.
2) Print expected string when nothing logged at level.
3) Check to ensure no unexpected logging occurred at other levels when nothing
logged at expected level.
2011-10-27 17:48:15 +01:00
Alex Bramley
88a664833e
Oops. I was just being fail.
2011-10-22 16:59:28 +01:00
Alex Bramley
63c7915933
Srsly, fffffuuuu.
2011-10-22 16:45:53 +01:00
Alex Bramley
eea12a554b
Hmm, slice out of range error, wtf x3!
2011-10-22 16:44:28 +01:00
Alex Bramley
1df07d2ff6
Hmm, slice out of range error, wtf x2.
2011-10-22 16:42:24 +01:00
Alex Bramley
ebc34cdce5
Hmm, slice out of range error, wtf.
2011-10-22 16:40:47 +01:00
Alex Bramley
4ee7aac968
oops, this is not a Logger.
2011-10-22 16:18:57 +01:00
Alex Bramley
dee808a263
Move logger mocks to a non-test file so they can be used elsewhere.
2011-10-22 16:15:46 +01:00
Alex Bramley
2467e5cc93
More tests for the logging package.
2011-10-22 15:43:13 +01:00
Alex Bramley
c769723596
Rewrite logging package for great justice.
...
Allowing people to use the static functions to log things makes testing
hard, so I've removed them. I've also rewritten things to allow logging
different levels to separate files.
2011-10-22 12:06:18 +01:00
Alex Bramley
9773b47969
Maintain constant call depth in logging to ensure correct line numbers. More tests needed, too lazy.
2011-09-29 22:45:26 +01:00
Alex Bramley
26a482d8ea
Using two flagsets on os.Args causes confusion.
2011-09-29 21:31:05 +01:00
Alex Bramley
d07471b93a
Simpleish level-based logging library and the start of some tests.
2011-09-28 23:47:30 +01:00