lib/sample_cmdlet_patterns/commands/log_types.rb
# Execute LogTypes subcommand taking input from
# a input stream and writing to output stream
#
# sample: output.puts 'OK'
Execute LogTypes subcommand taking input from
a input stream and writing to output stream


Execute LogTypes subcommand taking input from a input stream and writing to output stream
def execute(input: $stdin, output: $stdout)
        logger = TTY::Logger.new do |config|
          config.types = {
            thanks: { level: :info },
            done: { level: :info }
          }
          config.handlers = [
            [:console, {
              styles: {
                thanks: {
                  symbol: '❤️ ',
                  label: 'thanks',
                  color: :magenta,
                  levelpad: 0
                },
                done: {
                  symbol: '!!',
                  label: 'done',
                  color: :green,
                  levelpad: 2
                }
              }
            }]
          ]
        end
        logger.thanks('Great work!')
        logger.done('Work done!')
        :gui
      end
def execute ( input : $stdin , output : $stdout ) logger = TTY :: Logger . new do | config | config . types = { thanks : { level : :info } , done : { level : :info } } config . handlers = [ [ :console , { styles : { thanks : { symbol : '❤️ ', label : 'thanks' , color : :magenta , levelpad : 0 } , done : { symbol : '!!' , label : 'done' , color : :green , levelpad : 2 } } } ] ] end logger . thanks ( 'Great work!' ) logger . done ( 'Work done!' ) :gui end
Execute LogTypes subcommand taking input from
a input stream and writing to output stream
Execute LogTypes subcommand taking input from a input stream and writing to output stream
input
output