logging

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2023 License: MIT Imports: 8 Imported by: 1

README

Logging Examples

Status logs

package main

import (
  "fmt"

  "github.com/D3Ext/maldev/logging"
)

func main(){
  test = "Example text!"

  logging.Goodln(test)
  logging.Badln(test) // Note the "ln" on the function as fmt functions
  logging.Infoln(test)

  fmt.Println("===============")

  logging.Good(test)
  logging.Bad(test)
  logging.Info(test)
}

Use colors

package main

import (
  "fmt"

  "github.com/D3Ext/maldev/logging"
)

func main(){
  test = "Example text!"

  logging.Greenln(test)
  logging.Redln(test)
  logging.Purpleln(test)
  logging.Blueln(test)
  logging.Cyanln(test)

  fmt.Println("============")

  logging.Green(test)
  logging.Red(test)
  logging.Purple(test)
  logging.Blue(test)
  logging.Cyan(test)

  fmt.Println("\n============")

  green_text := logging.SGreen(test)
  red_text := logging.SRed(test)
  purple_text := logging.SPurple(test)
  blue_text := logging.SBlue(test)
  cyan_text := logging.SCyan(test)

  fmt.Println(green_text)
  fmt.Println(red_text)
  fmt.Println(purple_text)
  fmt.Println(blue_text)
  fmt.Println(cyan_text)
}

Create banners

package main

import (
  "fmt"

  "github.com/D3Ext/maldev/logging"
)

func main(){
  logging.PrintBanner("Maldev")

  ascii := logging.GetBanner("Maldev")
  fmt.Println(ascii)
}

Print text with time

package main

import (
  "github.com/D3Ext/maldev/logging"
)

func main(){
  logging.TimePrintln("This is an example!")
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Append added in v0.1.2

func Append(b []byte, a ...any) []byte

func Appendf added in v0.1.2

func Appendf(b []byte, format string, a ...any) []byte

func Appendln added in v0.1.2

func Appendln(b []byte, a ...any) []byte

func Bad

func Bad(v ...interface{})

func Badln

func Badln(v ...interface{})

func Blue

func Blue(v ...interface{})

func Blueln

func Blueln(v ...interface{})

func Cyan

func Cyan(v ...interface{})

func Cyanln

func Cyanln(v ...interface{})

func Fatal added in v0.1.2

func Fatal(v ...any)

func Fatalf added in v0.1.2

func Fatalf(format string, v ...any)

func Fatalln added in v0.1.2

func Fatalln(v ...any)

func Fprint added in v0.1.2

func Fprint(w io.Writer, a ...any) (n int, err error)

func Fprintf added in v0.1.2

func Fprintf(w io.Writer, format string, a ...any) (n int, err error)

func GetBanner

func GetBanner(str_to_convert string) string

func GetTime

func GetTime() string

func Good

func Good(v ...interface{})

func Goodln

func Goodln(v ...interface{})

Println functions

func Green

func Green(v ...interface{})

func Greenln

func Greenln(v ...interface{})

func Info

func Info(v ...interface{})

func Infoln

func Infoln(v ...interface{})

func Panic added in v0.1.2

func Panic(v ...any)

func Panicf added in v0.1.2

func Panicf(format string, v ...any)

func Panicln added in v0.1.2

func Panicln(v ...any)

func Print added in v0.1.2

func Print(v ...any)

func PrintBanner

func PrintBanner(str_to_convert string)

func Printf added in v0.1.2

func Printf(format string, v ...any) (int, error)

func Println added in v0.1.2

func Println(v ...any)

func ProgressBar

func ProgressBar(spinner_text string, spinner_duration int, spinner_delay int)

func Purple

func Purple(v ...interface{})

func Purpleln

func Purpleln(v ...interface{})

func Red

func Red(v ...interface{})

func Redln

func Redln(v ...interface{})

func SBlue

func SBlue(v ...interface{}) string

func SCyan

func SCyan(v ...interface{}) string

func SGreen

func SGreen(v ...interface{}) string

func SPurple

func SPurple(v ...interface{}) string

func SRed

func SRed(v ...interface{}) string

func Sprintf added in v0.1.2

func Sprintf(format string, v ...any) string

func TimePrint

func TimePrint(input string)

func TimePrintln

func TimePrintln(input string)

func TimeSprint

func TimeSprint(input string) string

Types

This section is empty.

Jump to

Keyboard shortcuts

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