lite_logger 0.1.8 → 0.1.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 283f90541b2fb3caa1a0bef10bda6668aa060b9c98dbd14e1ccbd1bfe40ec840
4
- data.tar.gz: 125385af15559093117b87761cbbaa8ab22dd4a9f1783a4b082c0828e4e32003
3
+ metadata.gz: b6f9cf208cd9c2d034bf16b75086031807b784a07fc00b3b759b740d7aa2bfd2
4
+ data.tar.gz: f9e85c7a324c2587fe9b79c01758c64fa3dd592e00c8d86d244e1f7a0c765417
5
5
  SHA512:
6
- metadata.gz: 930654b332fe2068143c05378a81d0f281a2f26d9126e78f0c453b387082c9198bfbde4fdaf40bfd37c8b83ab3a17d5f6ba63bddf1943341fd34402a74d2c124
7
- data.tar.gz: 3a663dfe21319a5680b952b7a9976cf28cf290d8922cae13ef193ff1f2f457d82db5a9fd581b102267fbbdb890ba238a740736d51d0f859458a32c74456a0013
6
+ metadata.gz: c231e2fb2fcd6c45107d4d9edefa90c846a16a486c38fb445a6e6471ba6a5fda2a6d833f59739abab059aa01527296138377e57df711e354e6386741e0950f78
7
+ data.tar.gz: 70dc276b2011c7fc81bcaa661c8a9630dd6908a0797d14f5d79356ca5167bdfeb67e18910d94591ef7cf423b43bcae8b121d193cc946458633372bc8f519f97c
data/CHANGELOG.md CHANGED
@@ -5,6 +5,10 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [0.1.10] - 2026-04-02
9
+
10
+ - Update development dependencies in `Gemfile` and `Gemfile.lock`.
11
+
8
12
  ## [0.1.0] - 2024-05-24
9
13
 
10
14
  - Initial release
@@ -46,3 +50,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
46
50
  - Add optional custom formatter support for application-specific log output.
47
51
  - Create parent directories automatically when logging to a file destination.
48
52
  - Move development tools out of runtime dependencies.
53
+
54
+ ## [0.1.9] - 2026-03-29
55
+
56
+ - Expand the spec suite around global configuration, formatter errors, JSON timestamps, and append behavior.
57
+ - Refresh the README with examples for file logging, JSON output, custom formatters, and global configuration.
data/README.md CHANGED
@@ -28,17 +28,15 @@ gem install lite_logger
28
28
 
29
29
  ## Usage
30
30
 
31
- ### Example
31
+ ### Basic example
32
32
 
33
- #### In a Ruby class:
33
+ In a Ruby class:
34
34
 
35
35
  ```ruby
36
- # Require the gem
37
36
  require 'lite_logger'
38
37
 
39
38
  class MyClass
40
39
  def initialize
41
- # Initialize the logger
42
40
  @logger = LiteLogger::Logger.new
43
41
  end
44
42
 
@@ -49,19 +47,18 @@ class MyClass
49
47
  @logger.error('This is an error message')
50
48
  @logger.fatal('This is a fatal message')
51
49
 
52
- # [...]
53
50
  end
54
51
  end
55
52
  ```
56
53
 
57
- #### Logging to a file
54
+ ### Logging to a file
58
55
 
59
56
  ```ruby
60
57
  require 'lite_logger'
61
58
 
62
- @logger = LiteLogger::Logger.new
63
- @logger.destination = './application.log'
64
- @logger.info('Application started!')
59
+ logger = LiteLogger::Logger.new
60
+ logger.destination = './log/application.log'
61
+ logger.info('Application started!')
65
62
  ```
66
63
 
67
64
  Output:
@@ -70,6 +67,54 @@ Output:
70
67
  2024-07-10 18:58:07 -0300 [INFO] Application started!
71
68
  ```
72
69
 
70
+ Parent directories are created automatically when the destination is a file path.
71
+
72
+ ### JSON output
73
+
74
+ ```ruby
75
+ require 'lite_logger'
76
+
77
+ logger = LiteLogger::Logger.new
78
+ logger.format = :json
79
+ logger.info('Application started!')
80
+ ```
81
+
82
+ Example output:
83
+
84
+ ```json
85
+ {"level":"info","message":"Application started!","timestamp":"2026-03-29 21:00:00 -0300"}
86
+ ```
87
+
88
+ ### Custom formatter
89
+
90
+ Use `formatter` when you need full control over the rendered log line.
91
+
92
+ ```ruby
93
+ require 'lite_logger'
94
+ require 'time'
95
+
96
+ logger = LiteLogger::Logger.new
97
+ logger.destination = './log/custom.log'
98
+ logger.formatter = lambda do |level, message, time|
99
+ "[#{time.iso8601}] #{level.upcase}: #{message}"
100
+ end
101
+
102
+ logger.info('Application started!')
103
+ ```
104
+
105
+ ### Global configuration
106
+
107
+ ```ruby
108
+ require 'lite_logger'
109
+
110
+ LiteLogger.configure do |logger|
111
+ logger.level = :debug
112
+ logger.destination = './log/application.log'
113
+ end
114
+
115
+ LiteLogger.logger.info('Application started!')
116
+ ```
117
+
73
118
  ## Contributing
74
119
 
75
120
  Bug reports and pull requests are welcome: <https://github.com/dmferrari/lite_logger/pulls>.
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module LiteLogger
4
- VERSION = '0.1.8'
4
+ VERSION = '0.1.10'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lite_logger
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.8
4
+ version: 0.1.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Martin Ferrari