Categorygithub.com/muhammad-fakhri/go-libs/log
modulepackage
1.0.0
Repository: https://github.com/muhammad-fakhri/go-libs.git
Documentation: pkg.go.dev

# README

go-libs/log

Benchmark

What is being Tested

  • Compare native go log library vs. SLogger
  • Interface tested: string, large array(len=10000), slice of struct

Test Environment

OS          : Ubuntu 20.04 LTS (Focal Fossa)
Processor   : Intel(R) Core(TM) i5-8265U CPU @ 1.60GHz
HDD         ; 512GB PCIe SSD
RAM         : 8GB DDR4

Benchmark Result

Benchmark Name                                  Times Ran     Speed
-------------------------------------------------------------------------------
BenchmarkSLogNative_InfoSimple-8                603891	         1894 ns/op
BenchmarkSLog_InfoSimple-8                75752	        15770 ns/op
BenchmarkSLogNative_LogLargeArray-8             960	      1196428 ns/op
BenchmarkSLog_LogLargeArray-8             958	      1269085 ns/op
BenchmarkSLogNative_InfoWithComplexArgs-8       330326	         4217 ns/op
BenchmarkSLog_InfoWithComplexArgs-8       69301	        17514 ns/op
BenchmarkSLogNative_InfofWithComplexArgs-8      658681	         1894 ns/op
BenchmarkSLog_InfofWithComplexArgs-8      73563	        16348 ns/op

Benchmark Conclusion

  • native library run so much faster(6x-10x) when logging string & slice of struct
  • not so much difference when logging large array

# Packages

Package mock_log is a generated GoMock package.

# Functions

No description provided by the author
* * return a Slog object for logging and a Hook object * to capture the logging's output so that it can * be tested any further to check whether it has * the right structure and contents or not.

# Constants

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Variables

context key data added to map.
data map to contain values.
add key here for future request based value.
add key here for future request based value.
add key here for future request based value.

# Structs

No description provided by the author
No description provided by the author
No description provided by the author

# Interfaces

No description provided by the author