All Projects → muukii → Bulk

muukii / Bulk

Licence: mit
👨‍💻 Bulk is a library for buffering the objects. Pipeline(Sink) receives the object and emits the object bulked.

Programming Languages

swift
15916 projects

Projects that are alternatives of or similar to Bulk

Serverless Es Logs
A Serverless plugin to transport logs to ElasticSearch
Stars: ✭ 51 (-13.56%)
Mutual labels:  logging, logger
Yii2 Psr Log Target
Yii 2.0 log target that is able to write messages to PSR-3 compatible logger
Stars: ✭ 58 (-1.69%)
Mutual labels:  logging, logger
Jslogger
Integrate JavaScript Logging with ASP.NET Core Logging APIs
Stars: ✭ 19 (-67.8%)
Mutual labels:  logging, logger
Ios Sdk
AppSpector is a debugging service for mobile apps
Stars: ✭ 56 (-5.08%)
Mutual labels:  logging, logger
Heroku Logger
A dead simple logger, designed to be perfect for Heroku apps.
Stars: ✭ 57 (-3.39%)
Mutual labels:  logging, logger
Log
Structured logging package for Go.
Stars: ✭ 1,094 (+1754.24%)
Mutual labels:  logging, logger
Znetcs.aspnetcore.logging.entityframeworkcore
This is Entity Framework Core logger and logger provider. A small package to allow store logs in any data store using Entity Framework Core.
Stars: ✭ 24 (-59.32%)
Mutual labels:  logging, logger
G3log
G3log is an asynchronous, "crash safe", logger that is easy to use with default logging sinks or you can add your own. G3log is made with plain C++14 (C++11 support up to release 1.3.2) with no external libraries (except gtest used for unit tests). G3log is made to be cross-platform, currently running on OSX, Windows and several Linux distros. See Readme below for details of usage.
Stars: ✭ 677 (+1047.46%)
Mutual labels:  logging, logger
Escriba
📜 Logging on steroids
Stars: ✭ 30 (-49.15%)
Mutual labels:  logging, logger
Cartus
A structured logging abstraction with multiple backends.
Stars: ✭ 21 (-64.41%)
Mutual labels:  logging, logger
Simplog
A simple logger. No dependencies, no special features, just logging.
Stars: ✭ 17 (-71.19%)
Mutual labels:  logging, logger
Browser Logger
A dead simple logger, designed to be perfect for the browser.
Stars: ✭ 44 (-25.42%)
Mutual labels:  logging, logger
Snoopy
Snoopy is a small library that logs all program executions on your Linux/BSD system (a.k.a. Snoopy Logger).
Stars: ✭ 835 (+1315.25%)
Mutual labels:  logging, logger
Plog
Portable, simple and extensible C++ logging library
Stars: ✭ 1,061 (+1698.31%)
Mutual labels:  logging, logger
Logbook
An extensible Java library for HTTP request and response logging
Stars: ✭ 822 (+1293.22%)
Mutual labels:  logging, logger
Thoth
An Error Logger for Go
Stars: ✭ 22 (-62.71%)
Mutual labels:  logging, logger
Izumi
Productivity-oriented collection of lightweight fancy stuff for Scala toolchain
Stars: ✭ 423 (+616.95%)
Mutual labels:  logging, logger
Gf
GoFrame is a modular, powerful, high-performance and enterprise-class application development framework of Golang.
Stars: ✭ 6,501 (+10918.64%)
Mutual labels:  logging, logger
Gollum
An n:m message multiplexer written in Go
Stars: ✭ 883 (+1396.61%)
Mutual labels:  logging, logger
Loglevelnext
A modern logging library for Node.js that provides log level mapping to the console
Stars: ✭ 33 (-44.07%)
Mutual labels:  logging, logger

Bulk / BulkLogger

Version platforms

Bulk is a library for buffering the objects. Pipeline(Sink) receives the object and emits the object bulked.

What is for?

To pack a lot of elements would be helpful in several cases. For example, sending the analytics events for your products with in house API.

  • collect the many events
  • pack it into one
  • send these events as a set of events.

Bulk module

Make a sink

We call the pipeline that receives the object as Sink.

Sink receives the objects and emits the bulked object to multiple targets.

  1. Select the buffer.

To create a bulk, we can choose several types of the buffer.
Currently, Bulk provides 2 types below.

  • MemoryBuffer
  • FileBuffer

In this tutorial, we select MemoryBuffer.

  1. Create the target

Target receives the bulked object from Sink.

Bulk does not privides default implemented Target.
For now, you need to create it.

public protocol TargetType {

  associatedtype Element

  func write(items: [Element])
}
struct MyTarget<Element>: TargetType {

  func write(items: [Element]) {
    print(items)
  }
}

And finally, create BulkSink object.

let sink = BulkSink<String>(
  buffer: MemoryBuffer.init(size: 10).asAny(),
  targets: [
    MyTarget<String>().asAny()
  ]
)

Send the objects

sink.send("A")
sink.send("B")
sink.send("C")

sink sends the bulked object when Buffer receives the objects up to the specified size (10 elements in the example).

BulkLogger module

The Logger as a library on top of Bulk.

BulkLogger provies Logger object that wraps Sink inside.

let logger = Logger(context: "", sinks: [
  BulkSink<LogData>(
    buffer: MemoryBuffer.init(size: 10).asAny(),
    targets: [

      TargetUmbrella.init(
        transform: LogBasicFormatter().format,
        targets: [
          LogConsoleTarget.init().asAny()
        ]
      ).asAny(),

      OSLogTarget(subsystem: "BulkDemo", category: "Demo").asAny()
    ]
  )
    .asAny()
])

Logger object send the log data to 2 targets (LogConsoleTarget and OSLogTarget)

logger.verbose("Hello")

LICENSE

Bulk Framework is released under the MIT License.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].