'use strict'

const handleCourseMessage = require('./handleCourseMessage')
const handleUserMessage = require('./handleUserMessage')
const {type} = require('message-type')

module.exports = function (msg) {
  if (msg._desc.type === type.course) {
    console.info('\nHandling message for course...'.green)
    return handleCourseMessage(msg)
  } else if (msg._desc.type === type.user) {
    console.info('\nHandling message for user...'.green)
    return handleUserMessage(msg)
  } else {
    return Promise.resolve('Message type irrelevant for this app.....')
  }
}

@@ -163,16 +163,62 @@
 e-type')
+%0Aconst log = require('../server/init/logging')
 %0A%0Amodule
@@ -281,39 +281,35 @@
 e.course) %7B%0A    
-console
+log
 .info('%5CnHandlin
@@ -293,33 +293,41 @@
     log.info('%5Cn
-H
+Started h
 andling message 
@@ -330,18 +330,31 @@
 age 
-for
+to update a
  course
+ info
 ...'
@@ -450,15 +450,11 @@
     
-console
+log
 .inf
@@ -462,28 +462,61 @@
 ('%5Cn
-Handling message for
+Started handling the queue message to create/update a
  use
@@ -601,17 +601,22 @@
 esolve('
-M
+This m
 essage t
@@ -619,16 +619,19 @@
 ge type 
+is 
 irreleva

Update logging fir handleMessage