Skip to content

Latest commit

 

History

History
 
 

example7

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

example7

let's look at how we'd use the decorator pattern for logging things...

the example is basic, but you see

  • a custom logger
  • a struct with a string
  • a method to that struct that returns a "prefixed string" (and delays returning by 5s)
  • a decorator that uses the custom logger to log the start... and end... of when the method starts and returns

as always, please leave feedback / comments