message

package module
v0.0.0-...-e2becb2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 25, 2020 License: MIT Imports: 5 Imported by: 0

README

messageOutput

The component messageOutput lets users to write messages to different outputs like system standard output or logfile.

Documentation

Index

Constants

View Source
const DEBUG int = 3
View Source
const ERROR int = 2
View Source
const INFO int = 0

Constants definitions

View Source
const WARN int = 1

Variables

This section is empty.

Functions

func Write

func Write(message string)

Write a message wrapping fmt

func WriteDebug

func WriteDebug(message interface{})

Write a message wrapping fmt

func WriteError

func WriteError(message interface{})

Write a message wrapping fmt

func WriteInfo

func WriteInfo(message interface{})

Write a message wrapping fmt

func WriteWarn

func WriteWarn(message interface{})

Write a message wrapping fmt

Types

type Message

type Message struct {
	// where to write messages
	Writer io.Writer
	// contains filtered or unexported fields
}

Message struct Message its an object which contains all the atributes to manage the message writes into channel

func GetInstance

func GetInstance(l int) *Message

GetInstance: return an instance of the object Message. If no instance has been created, a new one is created

func GetMessager

func GetMessager() *Message

GetMessager message

func New

func New(l int, w io.Writer, f int) *Message

generate a new Message object

func (*Message) Debug

func (m *Message) Debug(msg ...interface{})

Debug write debug messages to logger

func (*Message) DestroyInstance

func (m *Message) DestroyInstance()

DestroyInstance method stops the printMachine

func (*Message) Error

func (m *Message) Error(msg ...interface{})

Error write error messages to logger

func (*Message) Info

func (m *Message) Info(msg ...interface{})

Info write info messages to logger

func (*Message) SetLogLevel

func (m *Message) SetLogLevel(l int)

SetLogLevel method set the loglevel to the gived one

func (*Message) Warn

func (m *Message) Warn(msg ...interface{})

Warn write warning messages to logger

func (*Message) WriteCh

func (m *Message) WriteCh(msg ...interface{})

WriteCh always send a message to be written

func (*Message) WriteChDebug

func (m *Message) WriteChDebug(msg ...interface{})

WriteChDebug send a message to be written by printMachine if the loglevel is greater or equal to debug

func (*Message) WriteChError

func (m *Message) WriteChError(msg ...interface{})

WriteChError send a message to be written by printMachine if the loglevel is greater or equal to error

func (*Message) WriteChInfo

func (m *Message) WriteChInfo(msg ...interface{})

WriteChInfo send a message to be written by printMachine if the loglevel is greater or equal to info

func (*Message) WriteChWarn

func (m *Message) WriteChWarn(msg ...interface{})

WriteChWarn send a message to be written by printMachine if the loglevel is greater or equal to warn

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL