log

package
v0.0.0-...-da8984f Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2015 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

/ Package log provides a useful logging subsystem for Hologram tools.

By default, it will log INFO-level messages to the system log and standard out, but DEBUG-level messages can be output to these sinks as well. By defaut DEBUG messages are suppressed.

Messages emitted to the terminal are colourised for easy visual parsing, if the terminal supports it. The following colours are used:

  • Info: White
  • Warning: Yellow
  • Error: Red
  • Debug: Cyan

The log format is as follows:

[WARNING] 06/11/2014 18:22:34Z Message text. [ERROR ] 06/11/2014 18:22:56Z Time to fail.

Copyright 2014 AdRoll, Inc.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2014 AdRoll, Inc.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2014 AdRoll, Inc.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2014 AdRoll, Inc.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Debug

func Debug(message string, v ...interface{})

func DebugMode

func DebugMode(status bool)

DebugMode sets the debug mode option for this built-in logger.

func Errorf

func Errorf(message string, v ...interface{})

func Info

func Info(message string, v ...interface{})

func NewColourisedTerminalSink

func NewColourisedTerminalSink() *terminalSink

Return a working logger that colourises output to the terminal according to level.

func NewMux

func NewMux() *logMux

func NewSyslogSink

func NewSyslogSink() *syslogSink

Return a working logger to Syslog.

func Warning

func Warning(message string, v ...interface{})

Types

type Sink

type Sink interface {
	Info(message string)
	Warning(message string)
	Error(message string)
	Debug(message string)
}

Sink implementers provide processing logic for messages emitted by Hologram programs.

Jump to

Keyboard shortcuts

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