-
Notifications
You must be signed in to change notification settings - Fork 246
Conversation
/cc @victorhurdugaci |
CloudBlobStream stream; | ||
try | ||
{ | ||
stream = await blob.OpenWriteAsync(false); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
false? What's the argument name
} | ||
|
||
/// <inheritdoc /> | ||
public void Dispose() | ||
{ | ||
_innerLoggerProvider.Dispose(); | ||
_loggerFactory.Dispose(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this can also be null
.
You didn't compile locally after your last changes, didn't you? 😏 (travis/appveyor) |
Don't tell anybody :) Also thank you for reviewing while on vacation. |
var fileName = _instanceId + "-" + _fileName; | ||
var azureBlobSink = new AzureBlobSink(container, _appName, fileName, messageFormatter, _batchSize, _period); | ||
var backgroundSink = new BackgroundSink(azureBlobSink, BackgroundSink.DefaultLogMessagesQueueSize); | ||
LoggerConfiguration loggerConfiguration = new LoggerConfiguration(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: var
} | ||
if (period <= TimeSpan.Zero) | ||
{ | ||
throw new ArgumentOutOfRangeException(nameof(period), $"{nameof(period)} should be longer then zero."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thAn
The code looks okay but it would be nice to have some tests that actually check the azure sdk part |
6dfa193
to
dad79f0
Compare
I tries to write tests but it's nearly impossible to mock out azure blob types. |
You could try to use the emulator for tests or you might want to take a look at WebJobs. I remember there was some storage mocking there. If you get any code from there, make sure you sync with Eilon first - he was the manager for that project. |
@victorhurdugaci added tests. |
{ | ||
logger.Information("Text " + i); | ||
} | ||
await Task.Delay(TimeSpan.FromSeconds(1)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no, no... use some sort of polling. Hardcoded wait times are evil
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can probably poll the buffer until you get the expected number of messages. (with a timeout, of course)
75f3da0
to
223cae6
Compare
@victorhurdugaci switched to |
logger.Information("Text " + i); | ||
} | ||
|
||
Assert.True(sink.CountdownEvent.Wait(TimeSpan.FromSeconds(1))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Be more reasonable. Give it 10 seconds
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
|
@victorhurdugaci
Which is unrelated to this PR. Merging. |
No description provided.