Skip to content

exinferis/logger

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Logger

Console.log with style

What?

Based on the great work of Adam Schwartz (http://adamschwartz.co) this little module brings a stylable logger class which can be used within your own apps.

Features

  • Safely call logger.print (instead of console.log) in any browser.
  • Use markdown syntax for quick formatting:
    • italiclog('this is *italic*')
    • boldlog('this word _bold_')
    • codelog('this word `code`')
  • Use a custom syntax to style text however you want: log('this is [c="color: red"]red[c]').

Support

Stylized logs are supported in the following browsers:

  • Chrome 26+
  • Firefox with Firebug
  • Safari Nightly (537.38+)

Usage

logger = new Logger( severity: "info" )

logger.print( level, context, message, additional ) 

String level: can be anything from this list: debug, info, warning, error, fatal
String context: The current context to be diplayed, very useful for webapps using "classes" or different bound contexts
String | Object | Array message: Main message to display
Any additional: Additional data to display…can be anything

About

Console.log with style

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • CoffeeScript 100.0%