Sha256: 9c24f5209cfa73bef756ede81213312107cc85350ef5215eac1fa418f1ac7544
Contents?: true
Size: 1.17 KB
Versions: 2
Compression:
Stored size: 1.17 KB
Contents
# This file showcases usage of logtail on Ruby projects # For more information visit https://github.com/logtail/logtail-ruby # SETUP # Include logtail library require "logtail" # Check for program arguments if ARGV.length != 1 puts "Program needs source token to run. Run the program as followed\nruby main.rb <source-token>" exit end # Create logger http_device = Logtail::LogDevices::HTTP.new(ARGV[0]) logger = Logtail::Logger.new(http_device) # LOGGING # Send debug logs messages using the debug() method logger.debug("Logtail is ready!") # Send informative messages about interesting events using the info() method logger.info("I am using Logtail!") # Send messages about worrying events using the warn() method # You can also log additional structured data logger.warn( "log structured data", item: { url: "https://fictional-store.com/item-123", price: 100.00 } ) # Send error messages using the error() method logger.error("Oops! An error occurred!") # Send messages about fatal events that caused the app to crash using the fatal() method logger.fatal("Application crash! Needs to be fixed ASP!") puts "All done! You can check your logs now."
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
logtail-0.1.9 | example-project/main.rb |
logtail-0.1.8 | example-project/main.rb |