Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Branch | Status |
---|---|
Release | |
Development |
Add this line to your application's Gemfile:
gem 'easy_logging'
And then execute:
$ bundle
Or install it yourself as:
$ gem install easy_logging
Add include EasyLogging
to any context (e.g. a class) you want to extend with logging functionality.
require 'easy_logging'
EasyLogging.log_destination = 'app.log'
EasyLogging.level = Logger::DEBUG
class YourClass
include EasyLogging
def do_something
# ...
logger.info 'something happened'
end
end
class YourOtherClass
include EasyLogging
def self.do_something
# ...
logger.info 'something happened'
end
end
YourClass.new.do_something
YourOtherClass.do_something
Output:
I, [2017-06-03T21:59:25.160686 #5900] INFO -- YourClass: something happened
I, [2017-06-03T21:59:25.160686 #5900] INFO -- YourOtherClass: something happened
Log settings are global for all loggers. Always configure EasyLogging before loading your application.
EasyLogging.log_destination = 'app.log'
Default: STDOUT
Since: v0.2.0
EasyLogging.level = Logger::DEBUG
Default: Logger::INFO
Since: v0.3.0
EasyLogging.formatter = proc do |severity, datetime, progname, msg|
severity + datetime + progname + msg
end
Default: Logger default
Since: v0.3.0
... is tricky but looking at the specs it's fairly easy to understand:
describe 'on the fly modification of logger configuration' do
context 'class level logger' do
it 'uses old config if EasyLogging was included before config change'
it 'uses new config if EasyLogging was included after config change'
end
context 'instance level logger' do
it 'uses old config if instance was created before config change'
it 'uses new config if instance was created after config change'
end
end
Any feedback is much appreciated.
I can only tailor this project to fit use-cases I know about - which are usually my own ones. If you find that this might be the right direction to solve your problem too but you find that it's suboptimal or lacks features don't hesitate to contact me.
Please let me know if you make use of this project so that I can prioritize further efforts.
This gem is developed using Bundler conventions. A good overview can be found here.
Bug reports and pull requests are welcome on GitHub at https://github.com/thisismydesign/easy_logging.
The gem is available as open source under the terms of the MIT License.
FAQs
Unknown package
We found that easy_logging demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.