
Security News
Follow-up and Clarification on Recent Malicious Ruby Gems Campaign
A clarification on our recent research investigating 60 malicious Ruby gems.
A wrapper around the logging
gem that makes instantiating logs easier. Also has a number of presets for file and standard output logging.
Add this line to your application's Gemfile:
gem 'logging_factory'
And then execute:
$ bundle
Or install it yourself as:
$ gem install logging_factory
By default all output is written to standard output. To use in your project:
public class MyClass
def initialize()
log = LoggingFactory::DEFAULT_FACTORY.log(self.class)
end
end
This will instantiate a log with the default configuration, specified by LoggingFactory::DEFAULT_LOG_CONFIGURATION
:
{
output: 'STDOUT',
truncate: false,
level: :debug,
format: '[%d] %-5l [%c]: %m\n'
}
To override this configuration you can modify a log instance like this:
public class MyClass
def initialize()
log = LoggingFactory::DEFAULT_FACTORY.log(self.class, output: 'myproject.log')
end
end
Or create a new factory instant for use in your project:
MY_LOG_FACTORY = LoggingFactory.create (
output: 'myproject.log'
)
This will create an factory that will use the myproject.log
for logging. Other options which are no supplied will fall back to the default unless explicitly overridden.
See spec/my_log.log
for an example (run tests to generate this file).
Standard output:
Log file:
[2013-09-19 23:12:18] DEBUG [LogExample] This is a debug message
[2013-09-19 23:12:18] INFO [LogExample] This is an informational message
[2013-09-19 23:12:18] WARN [LogExample] This is an warning message
[2013-09-19 23:12:18] ERROR [LogExample] This is an error message
[2013-09-19 23:12:18] FATAL [LogExample] This is a fatal message
git checkout -b my-new-feature
)git commit -am 'Add some feature'
)git push origin my-new-feature
)FAQs
Unknown package
We found that logging_factory 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.
Security News
A clarification on our recent research investigating 60 malicious Ruby gems.
Security News
ESLint now supports parallel linting with a new --concurrency flag, delivering major speed gains and closing a 10-year-old feature request.
Research
/Security News
A malicious Go module posing as an SSH brute forcer exfiltrates stolen credentials to a Telegram bot controlled by a Russian-speaking threat actor.