update debug log usage and add fanciness to log printing
This commit is contained in:
parent
91498926d5
commit
1f192607b2
8 changed files with 27 additions and 25 deletions
|
|
@ -17,7 +17,10 @@
|
|||
|
||||
package ast
|
||||
|
||||
import "gitlab.com/whom/shs/log"
|
||||
import (
|
||||
"fmt"
|
||||
"gitlab.com/whom/shs/log"
|
||||
)
|
||||
|
||||
/* expected function header for any stdlib function
|
||||
*/
|
||||
|
|
@ -61,8 +64,12 @@ func (f Function) ParseFunction(args *Token) bool {
|
|||
|
||||
if i != 0 {
|
||||
log.Log(log.ERR,
|
||||
"Incorrect number of arguments",
|
||||
"eval")
|
||||
"Incorrect number of arguments",
|
||||
"eval")
|
||||
log.Log(log.DEBUG,
|
||||
fmt.Sprintf("Function %s expects %d arguments. You've provided %d arguments.",
|
||||
f.Name, f.Args, f.Args - i),
|
||||
"eval")
|
||||
return false
|
||||
}
|
||||
|
||||
|
|
@ -89,7 +96,7 @@ func (f Function) CallFunction(args *Token, vt VarTable, ft FuncTable) *Token {
|
|||
func GetFunction(arg string, table FuncTable) *Function {
|
||||
target, ok := (*table)[arg]
|
||||
if !ok {
|
||||
log.Log(log.DEBUG,
|
||||
log.Log(log.INFO,
|
||||
"function " + arg + " not found",
|
||||
"ftable")
|
||||
return nil
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue