Skip to content

Releases: brainfinance/StackdriverLogging

4.2.0

Choose a tag to compare

@jordanebelanger jordanebelanger released this 15 Oct 21:12
2b86b3f

Add the ability to flag error logs for pickup in GCP Error Reporting.

4.1.0

Choose a tag to compare

@jordanebelanger jordanebelanger released this 19 Feb 13:52
e75c4d0

Added the ability to disable source location logging

Thanks @0xTim !

4.0.1

Choose a tag to compare

@jordanebelanger jordanebelanger released this 07 Jan 17:46
b74757b

Fix the http request metadata logging function logging the request size instead of the response size.

Thanks @0xTim !

4.0.0

Choose a tag to compare

@jordanebelanger jordanebelanger released this 24 Apr 14:13
ce7461d

Modernize the implementation overall.

Changes

  • Make the setup of EventLoopGroup unnecessary and switch the worker queue to NIOThreadPool.
  • Use swift-system for file I/O.
  • Remove StackdriverLogHandler.Factory, as there is no need for setup due to the default singleton NIOThreadPool.
    Those who want customization can use their own NIOThreadPool.
    Delete old test support files for Linux and additionally implement tests.

Many thanks @sidepelican 👍

3.1.0

Choose a tag to compare

@jordanebelanger jordanebelanger released this 30 Jan 20:45
eecf479

Add support for the new swift-log metadata provider.

Thanks for the contribution @Sherlouk

3.0.0

Choose a tag to compare

@jordanebelanger jordanebelanger released this 23 Nov 19:51
2e8fcec

This release replaces the old configuration parameter with a new StackdriverLogHandler.Destination parameter when preparing the StackdriverLogHandler.Factory.

This new destination parameter permits logging to stdout rather than always logging to a physical file. This will be very useful for people running their application under GCP Cloud Run as it automatically push stdout logs to stackdriver.

The factory preparation process has also been changed, the NIO dependencies used to write log entries are now created for you, but you must make sure to shutdown these dependencies before your application exists.

A typical bootstrap scenario will now look like this:

try StackdriverLogHandler.Factory.prepare(for: .stdout)
defer {
    try! StackdriverLogHandler.Factory.syncShutdownGracefully()
}
let logLevel = Logger.Level.info
LoggingSystem.bootstrap { label -> LogHandler in
    var logger = StackdriverLogHandler.Factory.make()
    logger.logLevel = logLevel
    return logger
}

2.2.2

Choose a tag to compare

@jordanebelanger jordanebelanger released this 23 Nov 18:01
3f48cf9

Update readme

Remove mac os 10_14 dependency

Choose a tag to compare

@jordanebelanger jordanebelanger released this 06 Mar 20:09
2.2.1

Update package swift to remove the v10_14 dependency

Manual NIO dependencies factory's preparation

Choose a tag to compare

@jordanebelanger jordanebelanger released this 25 Nov 15:44

The responsibility of creating the NonBlockingFileIO and the processing EventLoopGroup has been moved to the client so that client's can cleanly shut them down when their application is shuts down.

What this means is that the LogHandler factory must now be prepared with the NIO dependencies manually, they are no longer created automatically.

StackdriverLogHandlerFactory.prepare(with: configuration,
                                     fileIO: fileIO,
                                     eventLoopGroup: eventLoopGroup)

Logging timestamps automatically

Choose a tag to compare

@jordanebelanger jordanebelanger released this 19 Nov 22:08

Timestamps were only optionally attached to log entries, they are now always attached, otherwise, due to the async nature of the log writing, the timestamps shown by stackdriver are off.